Skip to content

Commit

Permalink
Merge pull request jfacoustic#14 from cwesterhold/main
Browse files Browse the repository at this point in the history
update web to programtically include detailed response
  • Loading branch information
jfacoustic authored Oct 4, 2022
2 parents 7caf2e7 + 4443886 commit ea47850
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/flutter_auth0_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class FlutterAuth0Client {
final String audience;
final String? scheme;
final bool useEphemeral;
final bool detailedResponse;

FlutterAuth0Client({
required this.clientId,
Expand All @@ -42,6 +43,7 @@ class FlutterAuth0Client {
this.scope = "",
this.audience = "",
this.useEphemeral = false,
this.detailedResponse = false,
});

Future<Auth0Credentials> login() async {
Expand All @@ -54,7 +56,8 @@ class FlutterAuth0Client {
"scope": scope,
"audience": audience,
"useEphemeral": useEphemeral,
"scheme": scheme
"scheme": scheme,
"detailedResponse": detailedResponse,
});
final decodedJson = jsonDecode(rawJson);
return Auth0Credentials.fromJSON(decodedJson);
Expand Down
4 changes: 3 additions & 1 deletion lib/flutter_auth0_client_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ class FlutterAuth0ClientWeb {
scope: args['scope'], audience: args['audience']);
}
final token = await client.getTokenSilently(
detailedResponse: true, audience: args['audience']);
detailedResponse: args['detailedResponse'], audience: args['audience']);
Map<String, dynamic> tokenMap = {
'accessToken': token.accessToken,
'idToken': token.idToken,
'expiresIn': token.expiresIn
};
return jsonEncode(tokenMap);
}


}

0 comments on commit ea47850

Please sign in to comment.