aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/login
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/login')
-rw-r--r--src/routes/login/+server.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/routes/login/+server.ts b/src/routes/login/+server.ts
index 7313f13..d206e7e 100644
--- a/src/routes/login/+server.ts
+++ b/src/routes/login/+server.ts
@@ -6,14 +6,16 @@ export const GET = async (event) => {
let desiredScopes = event.url.searchParams.get('scope') ?? 'default';
desiredScopes = desiredScopes
.split(' ')
- .flatMap((v) => (v === 'default' ? 'vm-own-read vm-own-write' : ''))
+ .flatMap((v) => (v === 'default' ? 'vm-own-read vm-own-write' : v))
.join(' ');
if (new URL(target, event.url.href).host !== event.url.host) target = '/';
const existingScopes = (event.cookies.get('oid__scopes') ?? '').split(' ');
const authed = await event.locals.auth();
const missingScopes = !!desiredScopes
.split(' ')
+ .filter((v) => v)
.find((v) => !existingScopes.includes(v));
+
if (
// if we're not authenticated
!authed ||