@samitouri / QOSami-HFS / commits / e5c0741c

fix: error "reading allow_sesion_ip_change" when logging in using http basic authentication #768

Massimo Melina committed Oct 9, 2024 at 10:28 UTC e5c0741cd0baa586bbdeed129ec30963233567a1
1 file changed +1 -1
src/auth.ts
+1 -1
@@ -53,7 +53,7 @@ export async function setLoggedIn(ctx: Context, username: string | false) {
53 s.username = normalizeUsername(username)
54 s.ts = Date.now()
55 const k = CFG.allow_session_ip_change
56 - s[k] = Boolean(ctx.state.params[k])
56 + s[k] = k in ctx.query || Boolean(ctx.state.params?.[k]) || undefined
57 if (!a.expire && a.days_to_live)
58 updateAccount(a, { expire: new Date(Date.now() + a.days_to_live! * DAY) })
59 await events.emitAsync('login', ctx)