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
|
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() {
|
for name, api := range apiRegistry.GetAllAPIs() {
|
||||||
routeableApi, ok := api.(router.RoutableAPI)
|
routeableApi, ok := api.(router.RoutableAPI)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|
|
@ -118,7 +118,7 @@ func (a AccountAPI) login(jc jape.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
account.SetAuthCookie(jc, "")
|
account.SetAuthCookie(jc, jwt, "")
|
||||||
account.SendJWT(jc, jwt)
|
account.SendJWT(jc, jwt)
|
||||||
|
|
||||||
jc.Encode(&LoginResponse{
|
jc.Encode(&LoginResponse{
|
||||||
|
@ -213,7 +213,7 @@ func (a AccountAPI) otpValidate(jc jape.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
account.SetAuthCookie(jc, "")
|
account.SetAuthCookie(jc, jwt, "")
|
||||||
account.SendJWT(jc, jwt)
|
account.SendJWT(jc, jwt)
|
||||||
|
|
||||||
jc.Encode(&LoginResponse{
|
jc.Encode(&LoginResponse{
|
||||||
|
|
Loading…
Reference in New Issue