fix: SetAuthCookie needs the jwt
This commit is contained in:
parent
675a583422
commit
d893216831
|
@ -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 {
|
||||
|
|
|
@ -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{
|
||||
|
|
Loading…
Reference in New Issue