added right amount of return

This commit is contained in:
Snorre lothar von Gohren Edwin 2015-12-20 09:25:50 +01:00
parent 5d11392aac
commit 1f970af1f8
1 changed files with 1 additions and 1 deletions

View File

@ -85,7 +85,7 @@ func (t *Token) SigningString() (string, error) {
// If everything is kosher, err will be nil
func Parse(tokenString string, keyFunc Keyfunc) (*Token, error) {
if strings.Contains(strings.ToLower(tokenString), "bearer") {
return &ValidationError{err: "tokenstring should not contain bearer", Errors: ValidationErrorMalformed}
return nil, &ValidationError{err: "tokenstring should not contain bearer", Errors: ValidationErrorMalformed}
}
return new(Parser).Parse(tokenString, keyFunc)
}