fix jwt auth

This commit is contained in:
Kochan 2018-11-26 21:09:42 +01:00
parent 9b27282ee3
commit 1b261b983c
5 changed files with 23 additions and 22 deletions

View file

@ -187,7 +187,7 @@ func (rs *Resource) token(w http.ResponseWriter, r *http.Request) {
browser, _ := ua.Browser()
token := &jwt.Token{
Token: uuid.NewV4().String(),
Token: uuid.Must(uuid.NewV4()).String(),
Expiry: time.Now().Add(rs.TokenAuth.JwtRefreshExpiry),
UpdatedAt: time.Now(),
AccountID: acc.ID,
@ -247,7 +247,7 @@ func (rs *Resource) refresh(w http.ResponseWriter, r *http.Request) {
return
}
token.Token = uuid.NewV4().String()
token.Token = uuid.Must(uuid.NewV4()).String()
token.Expiry = time.Now().Add(rs.TokenAuth.JwtRefreshExpiry)
token.UpdatedAt = time.Now()