removed useless data from cookie
Massimo Melina committed
Jun 25, 2023 at 21:33 UTC
0500050d45e9b355200775f8f0f3716f980706d1
1 file changed
+1
-1
src/api.auth.ts
+1
-1
@@ -31,7 +31,6 @@ async function loggedIn(ctx:Koa.Context, username: string | false) {
31
}
32
s.username = normalizeUsername(username)
33
await prepareState(ctx, async ()=>{}) // updating the state is necessary to send complete session data so that frontend shows admin button
34
- delete s.login
34
ctx.cookies.set('csrf', randomId(), { signed:false, httpOnly: false })
35
}
36
@@ -100,6 +99,7 @@ export const loginSrp2: ApiHandler = async ({ pubKey, proof }, ctx) => {
99
try {
100
const M2 = await step1.step2(BigInt(pubKey), BigInt(proof))
101
await loggedIn(ctx, username)
102
+ delete ctx.session.loggingIn
103
return {
104
proof: String(M2),
105
redirect: ctx.state.account?.redirect,