mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-22 12:41:10 +10:00
fix: oidc scopes override
This commit is contained in:
@ -66,6 +66,7 @@ export class OIDCManager {
|
|||||||
|
|
||||||
async create() {
|
async create() {
|
||||||
const wellKnownUrl = process.env.OIDC_WELLKNOWN as string | undefined;
|
const wellKnownUrl = process.env.OIDC_WELLKNOWN as string | undefined;
|
||||||
|
const scopes = process.env.OIDC_SCOPES as string | undefined;
|
||||||
let configuration: OIDCWellKnown;
|
let configuration: OIDCWellKnown;
|
||||||
if (wellKnownUrl) {
|
if (wellKnownUrl) {
|
||||||
const response: OIDCWellKnown = await $fetch<OIDCWellKnown>(wellKnownUrl);
|
const response: OIDCWellKnown = await $fetch<OIDCWellKnown>(wellKnownUrl);
|
||||||
@ -77,6 +78,9 @@ export class OIDCManager {
|
|||||||
) {
|
) {
|
||||||
throw new Error("Well known response was invalid");
|
throw new Error("Well known response was invalid");
|
||||||
}
|
}
|
||||||
|
if (scopes) {
|
||||||
|
response.scopes_supported = scopes.split(",");
|
||||||
|
}
|
||||||
|
|
||||||
configuration = response;
|
configuration = response;
|
||||||
} else {
|
} else {
|
||||||
@ -85,7 +89,6 @@ export class OIDCManager {
|
|||||||
| undefined;
|
| undefined;
|
||||||
const tokenEndpoint = process.env.OIDC_TOKEN as string | undefined;
|
const tokenEndpoint = process.env.OIDC_TOKEN as string | undefined;
|
||||||
const userinfoEndpoint = process.env.OIDC_USERINFO as string | undefined;
|
const userinfoEndpoint = process.env.OIDC_USERINFO as string | undefined;
|
||||||
const scopes = process.env.OIDC_SCOPES as string | undefined;
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!authorizationEndpoint ||
|
!authorizationEndpoint ||
|
||||||
|
|||||||
Reference in New Issue
Block a user