AuthJWT 400->401
This commit is contained in:
1 parent
ee0763100b
commit
382d034fdd
3 files changed
+4
-4
No files matched your search
+1
-1
Submodule gluon/packages/dal updated: e595b921b0...db943c12cb.
+1
-1
Submodule gluon/packages/yatl updated: 468c093ab0...5deb403a9e.
+2
-2
@@ -3726,7 +3726,7 @@ class Auth(AuthAPI):
|
|||||||
are passed to the constructor of class AuthJWT. Look there for documentation.
|
are passed to the constructor of class AuthJWT. Look there for documentation.
|
||||||
"""
|
"""
|
||||||
if not self.jwt_handler:
|
if not self.jwt_handler:
|
||||||
raise HTTP(400, "Not authorized")
|
raise HTTP(401, "Not authorized")
|
||||||
else:
|
else:
|
||||||
rtn = self.jwt_handler.jwt_token_manager()
|
rtn = self.jwt_handler.jwt_token_manager()
|
||||||
raise HTTP(200, rtn, cookies=None, **current.response.headers)
|
raise HTTP(200, rtn, cookies=None, **current.response.headers)
|
||||||
@@ -3820,7 +3820,7 @@ class Auth(AuthAPI):
|
|||||||
|
|
||||||
def allows_jwt(self, otherwise=None):
|
def allows_jwt(self, otherwise=None):
|
||||||
if not self.jwt_handler:
|
if not self.jwt_handler:
|
||||||
raise HTTP(400, "Not authorized")
|
raise HTTP(401, "Not authorized")
|
||||||
else:
|
else:
|
||||||
return self.jwt_handler.allows_jwt(otherwise=otherwise)
|
return self.jwt_handler.allows_jwt(otherwise=otherwise)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user