auth-backend-module-oidc-provider: enable persisted scopes

Signed-off-by: Dmitry Gusev <gusevda90@gmail.com>
This commit is contained in:
Dmitry Gusev
2024-02-08 20:10:25 +03:00
parent 52941b2639
commit 316fdd66fd
@@ -42,6 +42,7 @@ export type OidcAuthResult = {
/** @public */
export const oidcAuthenticator = createOAuthAuthenticator({
shouldPersistScopes: true,
defaultProfileTransform: async (
input: OAuthAuthenticatorResult<OidcAuthResult>,
) => ({
@@ -162,9 +163,6 @@ export const oidcAuthenticator = createOAuthAuthenticator({
if (!tokenset.access_token) {
throw new Error('Refresh failed');
}
if (!tokenset.scope) {
tokenset.scope = input.scope;
}
const userinfo = await client.userinfo(tokenset.access_token);
return new Promise((resolve, reject) => {