1
0
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:
杨赫然 2024-12-24 14:15:55 +08:00
parent db8c637c68
commit bcaf97288b

View File

@ -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
}
}