From 675a583422d1920aa0faacfdbae855859874e3fb Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 17 Mar 2024 09:15:47 -0400 Subject: [PATCH] refactor: update SetAuthCookie to use routeableApi.AuthTokenName() --- account/jwt.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/account/jwt.go b/account/jwt.go index c91e276..6e73083 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, token string, apiName string) { +func SetAuthCookie(jc jape.Context, apiName string) { for name, api := range apiRegistry.GetAllAPIs() { routeableApi, ok := api.(router.RoutableAPI) if !ok { @@ -112,7 +112,7 @@ func SetAuthCookie(jc jape.Context, token string, apiName string) { http.SetCookie(jc.ResponseWriter, &http.Cookie{ Name: name, - Value: token, + Value: routeableApi.AuthTokenName(), Expires: time.Now().Add(24 * time.Hour), Secure: true, HttpOnly: true,