diff --git a/middleware/accounts.go b/middleware/accounts.go index 6d56422..efec9ef 100644 --- a/middleware/accounts.go +++ b/middleware/accounts.go @@ -38,7 +38,7 @@ func init() { if err != nil { panic(err) } - refreshExpiration, err = strconv.Atoi(os.Getenv("jwt_access_expiration")) + refreshExpiration, err = strconv.Atoi(os.Getenv("jwt_refresh_expiration")) if err != nil { panic(err) } @@ -246,12 +246,6 @@ var Refresh = func(w http.ResponseWriter, r *http.Request) { resp["access_token"] = acc.Token resp["refresh_token"] = acc.RefreshToken - //update refresh expirity - - // rt := time.Now().Add(time.Minute * time.Duration(refreshExpiration)).Unix() - // log.Println(rt) - // db.Model(&acc).Update(acc.TokenExpiresAt, rt) - respond(w, resp) } @@ -260,9 +254,9 @@ func ValidateToken(w http.ResponseWriter, r *http.Request) (*TokenDetails, error var pwd string urltomatch := r.URL.String() if strings.Contains(urltomatch, "/api/user/refresh") { - pwd = "refresh_token_password" + pwd = "jwt_refresh_token_password" } else { - pwd = "access_token_password" + pwd = "jwt_access_token_password" } response := make(map[string]interface{})