login and register also stores a http-only cookie
This commit is contained in:
parent
21f3a3d000
commit
c3d610cbf7
@ -42,5 +42,12 @@ func Login(ctx *fiber.Ctx) error {
|
||||
return err
|
||||
}
|
||||
|
||||
ctx.Cookie(&fiber.Cookie{
|
||||
Name: "accessToken",
|
||||
Value: token,
|
||||
HTTPOnly: true,
|
||||
SameSite: "Strict",
|
||||
})
|
||||
|
||||
return ctx.JSON(LoginResponse{Token: token})
|
||||
}
|
||||
|
@ -41,5 +41,12 @@ func Register(ctx *fiber.Ctx) error {
|
||||
return err
|
||||
}
|
||||
|
||||
ctx.Cookie(&fiber.Cookie{
|
||||
Name: "accessToken",
|
||||
Value: token,
|
||||
HTTPOnly: true,
|
||||
SameSite: "Strict",
|
||||
})
|
||||
|
||||
return ctx.JSON(LoginResponse{Token: token})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user