Trying to fix 403 on many requests #143

This commit is contained in:
Henrique Dias
2017-07-19 08:28:01 +01:00
parent 52e12c0b23
commit d48867f603
3 changed files with 7 additions and 10 deletions

View File

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