mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-02 16:16:02 +00:00
Merge remote-tracking branch 'origin/main' into feat/jsonv-refactor
# Conflicts: # bun.lock
This commit is contained in:
@@ -334,9 +334,9 @@ export class Authenticator<Strategies extends Record<string, Strategy> = Record<
|
||||
await setSignedCookie(c, "auth", token, secret, this.cookieOptions);
|
||||
}
|
||||
|
||||
private async deleteAuthCookie(c: Context) {
|
||||
private deleteAuthCookie(c: Context) {
|
||||
$console.debug("deleting auth cookie");
|
||||
await deleteCookie(c, "auth", this.cookieOptions);
|
||||
deleteCookie(c, "auth", this.cookieOptions);
|
||||
}
|
||||
|
||||
async logout(c: Context<ServerEnv>) {
|
||||
@@ -345,9 +345,13 @@ export class Authenticator<Strategies extends Record<string, Strategy> = Record<
|
||||
|
||||
const cookie = await this.getAuthCookie(c);
|
||||
if (cookie) {
|
||||
await this.deleteAuthCookie(c);
|
||||
await addFlashMessage(c, "Signed out", "info");
|
||||
addFlashMessage(c, "Signed out", "info");
|
||||
}
|
||||
|
||||
// on waku, only one cookie setting is performed
|
||||
// therefore adding deleting cookie at the end
|
||||
// as the flash isn't that important
|
||||
this.deleteAuthCookie(c);
|
||||
}
|
||||
|
||||
// @todo: move this to a server helper
|
||||
|
||||
Reference in New Issue
Block a user