allow custom_scope to be demanded by vikunja, add scope to IProvider

This commit is contained in:
viehlieb 2023-01-30 14:51:24 +01:00
parent 652d3c7384
commit 77f0776d0b
2 changed files with 7 additions and 1 deletions

View File

@ -17,7 +17,12 @@ export const redirectToProvider = (provider: IProvider) => {
const state = createRandomID(24)
localStorage.setItem('state', state)
window.location.href = `${provider.authUrl}?client_id=${provider.clientId}&redirect_uri=${redirectUrl}&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}`
}
export const redirectToProviderOnLogout = (provider: IProvider) => {
if (provider.logoutUrl.length > 0) {

View File

@ -4,4 +4,5 @@ export interface IProvider {
authUrl: string;
clientId: string;
logoutUrl: string;
scope: string;
}