Trying to fix 403 on many requests #143
Former-commit-id: 372cd53a6822a5e308b1db41593d1285f4c4ea22 [formerly 32161936b6b381a5c945ac404005f00cbc947499] [formerly 9572d67b6ead3d407f5899dcb46c2c7527fea437 [formerly d48867f603d3c2a7dccbf32c95ca498403ef710d]] Former-commit-id: 411c250031965f3e66c8acb341871800c120e637 [formerly 7801398085d8d8ed0e306e4fea63b94f6729b541] Former-commit-id: fe0c0ad2201510b10cb0ac724a3066ee4378fd67
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