Return 400 instead of 404 for bad token

This commit is contained in:
Sam
2018-10-12 10:51:41 +11:00
parent 048cdfbcfa
commit a1c912b630
3 changed files with 5 additions and 6 deletions

View File

@@ -382,10 +382,9 @@ class Guardian
end
def auth_token
return nil if !request&.cookies[Auth::DefaultCurrentUserProvider::TOKEN_COOKIE]
cookie = request.cookies[Auth::DefaultCurrentUserProvider::TOKEN_COOKIE]
UserAuthToken.hash_token(cookie)
if cookie = request&.cookies[Auth::DefaultCurrentUserProvider::TOKEN_COOKIE]
UserAuthToken.hash_token(cookie)
end
end
private