add variable scope to IProvider for oidc which defaults to openid email profile on redirect
This commit is contained in:
parent
90ecea74c7
commit
0bc6df020d
2 changed files with 4 additions and 2 deletions
|
@ -14,6 +14,7 @@ export const redirectToProvider = (provider: IProvider, redirectUrl = '') => {
|
|||
|
||||
const state = createRandomID(24)
|
||||
localStorage.setItem('state', state)
|
||||
|
||||
window.location.href = `${provider.authUrl}?client_id=${provider.clientId}&redirect_uri=${redirectUrl}${provider.key}&response_type=code&scope=openid email profile&state=${state}`
|
||||
let scope = 'openid email profile'
|
||||
if (provider.scope !== null) scope = provider.scope
|
||||
window.location.href = `${provider.authUrl}?client_id=${provider.clientId}&redirect_uri=${redirectUrl}${provider.key}&response_type=code&scope=openid email profile${scope}&state=${state}`
|
||||
}
|
||||
|
|
|
@ -3,4 +3,5 @@ export interface IProvider {
|
|||
key: string;
|
||||
authUrl: string;
|
||||
clientId: string;
|
||||
scope: string;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue