mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-09 03:08:57 +00:00
Validate token return 403 for go (#523)
This commit is contained in:
@@ -1034,7 +1034,11 @@ func validateToken(r *http.Request, repoID string, skipCache bool) (string, *app
|
|||||||
}
|
}
|
||||||
|
|
||||||
if value, ok := tokenCache.Load(token); ok {
|
if value, ok := tokenCache.Load(token); ok {
|
||||||
if info, ok := value.(*tokenInfo); ok && info.repoID == repoID {
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user