Closed sahilpaudel-pe closed 3 years ago
same thing here, returns the same token every time for a given account
@yieniggu perhaps add a nonce inside of your claims ..? or "iat" ,etc..
yeah, just solved by setting expiration
func (app *Config) newJSONToken (user_id string, username string, email string) string {
claims := map[string]interface{}{"user_id": user_id, "username": username, "email": email}
jwtauth.SetExpiry(claims, time.Now().Add(time.Hour * 2))
_, tokenString, _ := app.TokenAuth.Encode(claims)
return tokenString
}
module.go
user.go
Here the tokenString is giving same token everytime. Is this expected?