Remember last login
This commit is contained in:
@ -82,9 +82,9 @@ func (h *Handler) loginPost(c *gin.Context) {
|
||||
c.AbortWithError(http.StatusUnauthorized, err)
|
||||
}
|
||||
|
||||
_, _ = h.Service.DB.UpdateLastLogin(context.Background(), user.ID)
|
||||
maxAge := (int)((expiration * time.Hour).Seconds())
|
||||
c.SetCookie(authCookie, t, maxAge, "", "", false, true)
|
||||
|
||||
c.JSON(http.StatusOK, map[string]string{
|
||||
"token": t,
|
||||
})
|
||||
|
Reference in New Issue
Block a user