correct env vars
This commit is contained in:
parent
3f03090762
commit
8d8bdd175a
|
@ -38,7 +38,7 @@ func init() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
refreshExpiration, err = strconv.Atoi(os.Getenv("jwt_access_expiration"))
|
refreshExpiration, err = strconv.Atoi(os.Getenv("jwt_refresh_expiration"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
@ -246,12 +246,6 @@ var Refresh = func(w http.ResponseWriter, r *http.Request) {
|
||||||
resp["access_token"] = acc.Token
|
resp["access_token"] = acc.Token
|
||||||
resp["refresh_token"] = acc.RefreshToken
|
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)
|
respond(w, resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,9 +254,9 @@ func ValidateToken(w http.ResponseWriter, r *http.Request) (*TokenDetails, error
|
||||||
var pwd string
|
var pwd string
|
||||||
urltomatch := r.URL.String()
|
urltomatch := r.URL.String()
|
||||||
if strings.Contains(urltomatch, "/api/user/refresh") {
|
if strings.Contains(urltomatch, "/api/user/refresh") {
|
||||||
pwd = "refresh_token_password"
|
pwd = "jwt_refresh_token_password"
|
||||||
} else {
|
} else {
|
||||||
pwd = "access_token_password"
|
pwd = "jwt_access_token_password"
|
||||||
}
|
}
|
||||||
|
|
||||||
response := make(map[string]interface{})
|
response := make(map[string]interface{})
|
||||||
|
|
Loading…
Reference in New Issue