Skip to content

Commit 727ac64

Browse files
ecrodecode-asher
authored andcommitted
Clear password when redirecting to login
Should prevent endless redirects when the cookie is set on a different path or domain (like with a dot prefix).
1 parent 2c15c09 commit 727ac64

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/node/server.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,10 @@ export abstract class Server {
298298
return response;
299299
}
300300
if (!this.authenticate(request)) {
301-
return { redirect: "/login" };
301+
return {
302+
redirect: "/login",
303+
headers: { "Set-Cookie": `password=` }
304+
};
302305
}
303306
break;
304307
case "/static":

0 commit comments

Comments
 (0)