1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

feat: persist user creation date (resolve #31)

This commit is contained in:
Ferdinand Mütsch
2020-05-30 22:19:05 +02:00
parent 1872bf4b4c
commit c1e6a3e265
7 changed files with 111 additions and 69 deletions

View File

@ -9,6 +9,7 @@ import (
"github.com/muety/wakapi/utils"
"net/http"
"net/url"
"time"
)
type IndexHandler struct {
@ -106,6 +107,9 @@ func (h *IndexHandler) Login(w http.ResponseWriter, r *http.Request) {
return
}
user.LastLoggedInAt = models.CustomTime(time.Now())
h.userSrvc.Update(user)
cookie := &http.Cookie{
Name: models.AuthCookieKey,
Value: encoded,