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