Compare commits
3 Commits
v1.0.18
...
f8e7b01a28
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8e7b01a28 | ||
|
|
332a84aa57 | ||
|
|
e9fdea664f |
@@ -164,9 +164,8 @@ func (aH *AccessHandler) Refresh(c *gin.Context) {
|
||||
|
||||
username := claims["username"].(string)
|
||||
id := int(claims["id"].(float64))
|
||||
role := claims["role"].(string)
|
||||
|
||||
_, hasError := aH.getUserFromDB(c, username)
|
||||
user, hasError := aH.getUserFromDB(c, username)
|
||||
if hasError {
|
||||
return
|
||||
}
|
||||
@@ -177,7 +176,7 @@ func (aH *AccessHandler) Refresh(c *gin.Context) {
|
||||
newAccess := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
|
||||
"id": id,
|
||||
"username": username,
|
||||
"role": role,
|
||||
"role": user.Role,
|
||||
"exp": accessExp.Unix(),
|
||||
})
|
||||
accessString, _ := newAccess.SignedString(ACCESS_SECRET)
|
||||
|
||||
@@ -12,7 +12,7 @@ func (r *Permissions) DefaultPermissions() {
|
||||
*r = append(*r,
|
||||
Permission{Name: "settings", Permission: 7},
|
||||
Permission{Name: "userSettings", Permission: 7},
|
||||
Permission{Name: "members", Permission: 7},
|
||||
Permission{Name: "members", Permission: 15},
|
||||
Permission{Name: "events", Permission: 7},
|
||||
Permission{Name: "responsible", Permission: 7},
|
||||
)
|
||||
|
||||
@@ -12,6 +12,7 @@ type Settings struct {
|
||||
SecondaryColor string `json:"secondaryColor,omitempty"`
|
||||
SecondaryColorText string `json:"secondaryColorText,omitempty"`
|
||||
Icon string `json:"icon,omitempty"`
|
||||
AppName string `json:"appName,omitempty"`
|
||||
DatabaseName string `json:"databaseName,omitempty"`
|
||||
DatabaseToken string `json:"databaseToken,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user