mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-01 07:26:37 +00:00
Fix skip cache error
This commit is contained in:
@@ -1283,13 +1283,15 @@ func validateToken(r *http.Request, repoID string, skipCache bool) (string, *app
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if value, ok := tokenCache.Load(token); ok {
|
if !skipCache {
|
||||||
if info, ok := value.(*tokenInfo); ok {
|
if value, ok := tokenCache.Load(token); ok {
|
||||||
if info.repoID != repoID {
|
if info, ok := value.(*tokenInfo); ok {
|
||||||
msg := "Invalid token"
|
if info.repoID != repoID {
|
||||||
return "", &appError{nil, msg, http.StatusForbidden}
|
msg := "Invalid token"
|
||||||
|
return "", &appError{nil, msg, http.StatusForbidden}
|
||||||
|
}
|
||||||
|
return info.email, nil
|
||||||
}
|
}
|
||||||
return info.email, nil
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user