Added UserId cookie to user login

master
Alex 2021-08-10 12:35:22 +02:00
parent 6924c9ddbf
commit 7ac3c18831
1 changed files with 1 additions and 0 deletions

View File

@ -92,6 +92,7 @@ func Login(c *fiber.Ctx) error {
cfg := cfg.Settings.Cookies
c.Cookie(&fiber.Cookie{Name: cfg.UserId, Value: user.Id, Secure: true, Expires: expires})
c.Cookie(&fiber.Cookie{Name: cfg.SessionId, Value: sessionId, Secure: true, HTTPOnly: true, Expires: expires})
if user.Name != "" {
c.Cookie(&fiber.Cookie{Name: cfg.Username, Value: user.Name, Secure: true, Expires: expires})