fix: add code to query params + fix openid config

This commit is contained in:
Lakhan Samani
2022-10-20 14:29:47 +05:30
parent d8eceadd7f
commit c128f7e267
3 changed files with 13 additions and 6 deletions

View File

@@ -38,6 +38,7 @@ export default function Root({
const scope = searchParams.get('scope')
? searchParams.get('scope')?.toString().split(' ')
: ['openid', 'profile', 'email'];
const code = searchParams.get('code')
const urlProps: Record<string, any> = {
state,
@@ -58,6 +59,10 @@ export default function Root({
if (token) {
let redirectURL = config.redirectURL || '/app';
let params = `access_token=${token.access_token}&id_token=${token.id_token}&expires_in=${token.expires_in}&state=${globalState.state}`;
if (code) {
params += `&code=${code}`
}
if (token.refresh_token) {
params += `&refresh_token=${token.refresh_token}`;
}