Use cookie
This commit is contained in:
parent
fb298c9880
commit
a5ac3218ea
1 changed files with 5 additions and 9 deletions
|
@ -73,16 +73,13 @@ class ApiHelper {
|
|||
return Response(400, body: "Token post failed");
|
||||
}
|
||||
|
||||
final uri = Uri.parse(redirectUri).replace(
|
||||
queryParameters: {
|
||||
...Uri.parse(redirectUri).queryParameters,
|
||||
...(json.decode(await tokenRes.readAsString()) as Map).map(
|
||||
(key, value) => MapEntry(key, value.toString()),
|
||||
),
|
||||
return Response.found(
|
||||
redirectUri,
|
||||
headers: {
|
||||
'set-cookie':
|
||||
'id_token=${json.decode(await tokenRes.readAsString())["id_token"]};',
|
||||
},
|
||||
);
|
||||
|
||||
return Response.found(uri.toString());
|
||||
}
|
||||
|
||||
Future<Response> tokenHandler(Request request) async {
|
||||
|
@ -127,7 +124,6 @@ class ApiHelper {
|
|||
"id_token": token,
|
||||
"access_token": token,
|
||||
"token_type": "Bearer",
|
||||
"expires_in": 600,
|
||||
}),
|
||||
headers: {"Content-Type": "application/json"},
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue