forked from vikunja/frontend
extend provider toinclude scope which defaults to openid email profile on redirect
This commit is contained in:
parent
4657da8c90
commit
521277a45b
|
@ -15,5 +15,8 @@ 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=${scope}&state=${state}`
|
||||
}
|
||||
|
|
|
@ -3,4 +3,5 @@ export interface IProvider {
|
|||
key: string;
|
||||
authUrl: string;
|
||||
clientId: string;
|
||||
scope: string;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue