Skip to content

Commit

Permalink
Address review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
gferon committed Sep 19, 2024
1 parent a6dc2ac commit 83c6e64
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions auth0_flutter_platform_interface/lib/src/credentials.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,17 @@ class Credentials {
required this.tokenType,
});

factory Credentials.fromMap(final Map<dynamic, dynamic> result) {
print("Credentials::fromMap result.expiresAt ${result['expiresAt']}");
print(
"Credentials::fromMap result.expiresAt DateTime::parse().toUtc() ${DateTime.parse(result['expiresAt'] as String).toUtc()}");
return Credentials(
idToken: result['idToken'] as String,
accessToken: result['accessToken'] as String,
refreshToken: result['refreshToken'] as String?,
expiresAt: DateTime.parse(result['expiresAt'] as String).toUtc(),
scopes: Set<String>.from(result['scopes'] as List<Object?>),
user: UserProfile.fromMap(Map<String, dynamic>.from(
result['userProfile'] as Map<dynamic, dynamic>)),
tokenType: result['tokenType'] as String,
);
}
factory Credentials.fromMap(final Map<dynamic, dynamic> result) =>
Credentials(
idToken: result['idToken'] as String,
accessToken: result['accessToken'] as String,
refreshToken: result['refreshToken'] as String?,
expiresAt: DateTime.parse(result['expiresAt'] as String).toUtc(),
scopes: Set<String>.from(result['scopes'] as List<Object?>),
user: UserProfile.fromMap(Map<String, dynamic>.from(
result['userProfile'] as Map<dynamic, dynamic>)),
tokenType: result['tokenType'] as String,
);

Map<String, dynamic> toMap() => {
'idToken': idToken,
Expand Down

0 comments on commit 83c6e64

Please sign in to comment.