From d893216831bdd90cb9e2e47d905f5c6e46944250 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 17 Mar 2024 09:18:01 -0400 Subject: [PATCH] fix: SetAuthCookie needs the jwt --- account/jwt.go | 2 +- api/account/account.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/account/jwt.go b/account/jwt.go index 6e73083..10ab58a 100644 --- a/account/jwt.go +++ b/account/jwt.go @@ -99,7 +99,7 @@ func JWTVerifyToken(token string, domain string, privateKey ed25519.PrivateKey, return claim, err } -func SetAuthCookie(jc jape.Context, apiName string) { +func SetAuthCookie(jc jape.Context, jwt string, apiName string) { for name, api := range apiRegistry.GetAllAPIs() { routeableApi, ok := api.(router.RoutableAPI) if !ok { diff --git a/api/account/account.go b/api/account/account.go index d5783fc..aaf9ab5 100644 --- a/api/account/account.go +++ b/api/account/account.go @@ -118,7 +118,7 @@ func (a AccountAPI) login(jc jape.Context) { return } - account.SetAuthCookie(jc, "") + account.SetAuthCookie(jc, jwt, "") account.SendJWT(jc, jwt) jc.Encode(&LoginResponse{ @@ -213,7 +213,7 @@ func (a AccountAPI) otpValidate(jc jape.Context) { return } - account.SetAuthCookie(jc, "") + account.SetAuthCookie(jc, jwt, "") account.SendJWT(jc, jwt) jc.Encode(&LoginResponse{