aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/login/+server.ts
diff options
context:
space:
mode:
authorLibravatarLarge Libravatar memdmp <memdmpestrogenzone>2025-08-20 20:55:34 +0000
committerLibravatarLarge Libravatar memdmp <memdmpestrogenzone>2025-08-20 20:55:34 +0000
commit001fc710d8b662080098d8d7dcba2c668bcb0587 (patch)
tree56dbb373e0fa9fa5eeb49cf2fc2c42c1e152f2cb /src/routes/login/+server.ts
parent80d0342636056bc839517b64fd11708abea70237 (diff)
downloadcrunched-001fc710d8b662080098d8d7dcba2c668bcb0587.tar.gz
crunched-001fc710d8b662080098d8d7dcba2c668bcb0587.tar.bz2
crunched-001fc710d8b662080098d8d7dcba2c668bcb0587.tar.lz
crunched-001fc710d8b662080098d8d7dcba2c668bcb0587.zip

feat: do things

Diffstat (limited to 'src/routes/login/+server.ts')
-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 ||