Compare commits
1 Commits
v1.0.18
...
e9fdea664f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9fdea664f |
@@ -164,9 +164,8 @@ func (aH *AccessHandler) Refresh(c *gin.Context) {
|
|||||||
|
|
||||||
username := claims["username"].(string)
|
username := claims["username"].(string)
|
||||||
id := int(claims["id"].(float64))
|
id := int(claims["id"].(float64))
|
||||||
role := claims["role"].(string)
|
|
||||||
|
|
||||||
_, hasError := aH.getUserFromDB(c, username)
|
user, hasError := aH.getUserFromDB(c, username)
|
||||||
if hasError {
|
if hasError {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -177,7 +176,7 @@ func (aH *AccessHandler) Refresh(c *gin.Context) {
|
|||||||
newAccess := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
|
newAccess := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
|
||||||
"id": id,
|
"id": id,
|
||||||
"username": username,
|
"username": username,
|
||||||
"role": role,
|
"role": user.Role,
|
||||||
"exp": accessExp.Unix(),
|
"exp": accessExp.Unix(),
|
||||||
})
|
})
|
||||||
accessString, _ := newAccess.SignedString(ACCESS_SECRET)
|
accessString, _ := newAccess.SignedString(ACCESS_SECRET)
|
||||||
|
|||||||
Reference in New Issue
Block a user