Skip to content
Snippets Groups Projects
Commit 3d8908c7 authored by Max Kuzin's avatar Max Kuzin
Browse files

Merge branch 'Dev-2777' into 'master'

Аутентификация. Не хранить UserAccessInfo в кеше

See merge request polymatica/common/backend/tools!39
parents c811f0ef ad70a187
No related branches found
Tags v1.8.1
No related merge requests found
......@@ -76,13 +76,14 @@ func (u UserAuthHandler) Authenticate(c *gin.Context) (authenticated bool) {
return
}
if cacheData, _ := Cache.GetCache(token); cacheData != nil {
cache, ok := cacheData.(type_module.UserAccessInfo)
if ok {
c.Set(UserAccessInfo, cache)
return true
}
}
//TODO ждём event bus
//if cacheData, _ := Cache.GetCache(token); cacheData != nil {
// cache, ok := cacheData.(type_module.UserAccessInfo)
// if ok {
// c.Set(UserAccessInfo, cache)
// return true
// }
//}
requestBody := type_module.ModuleHasAccessRequest{
UseAccessControl: true,
......@@ -100,7 +101,8 @@ func (u UserAuthHandler) Authenticate(c *gin.Context) (authenticated bool) {
c.Set(UserAccessInfo, response.UserAccessInfo)
_ = Cache.SetCache(token, response.UserAccessInfo, CacheExpireTime)
//TODO ждём event bus
//_ = Cache.SetCache(token, response.UserAccessInfo, CacheExpireTime)
return true
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment