You've already forked filebrowser
mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-11-26 14:25:26 +08:00
Trying to fix 403 on many requests #143
This commit is contained in:
8
auth.go
8
auth.go
@@ -96,12 +96,12 @@ func (e extractor) ExtractToken(r *http.Request) (string, error) {
|
||||
return token, nil
|
||||
}
|
||||
|
||||
token, _ = request.ArgumentExtractor{"token"}.ExtractToken(r)
|
||||
if token != "" {
|
||||
return token, nil
|
||||
cookie, err := r.Cookie("auth")
|
||||
if err != nil {
|
||||
return "", request.ErrNoTokenInRequest
|
||||
}
|
||||
|
||||
return "", request.ErrNoTokenInRequest
|
||||
return cookie.Value, nil
|
||||
}
|
||||
|
||||
// validateAuth is used to validate the authentication and returns the
|
||||
|
||||
Reference in New Issue
Block a user