fix: add nonce to supported claims

This commit is contained in:
Lakhan Samani
2022-10-19 23:17:13 +05:30
parent a916b8c32c
commit de4381261e
4 changed files with 6 additions and 10 deletions

View File

@@ -39,7 +39,6 @@ export default function Root({
? searchParams.get('scope')?.toString().split(' ')
: ['openid', 'profile', 'email'];
const code = searchParams.get('code') || ''
const nonce = searchParams.get('nonce') || ''
const urlProps: Record<string, any> = {
state,
@@ -59,14 +58,12 @@ export default function Root({
useEffect(() => {
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}&code=`+code;
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 (nonce !== '') {
params += `&nonce=${nonce}`
}
if (token.refresh_token) {
params += `&refresh_token=${token.refresh_token}`;
}