mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-07-15 06:55:48 +00:00
rase 405 error in case if GET login method is used whereas no aioauth
library installed
This commit is contained in:
@ -64,7 +64,11 @@ class LoginView(BaseView):
|
||||
HTTPMethodNotAllowed: in case if method is used, but OAuth is disabled
|
||||
HTTPUnauthorized: if case of authorization error
|
||||
"""
|
||||
from ahriman.core.auth.oauth import OAuth
|
||||
try:
|
||||
from ahriman.core.auth.oauth import OAuth
|
||||
except ImportError:
|
||||
# no aioauth library found
|
||||
raise HTTPMethodNotAllowed(self.request.method, ["POST"])
|
||||
|
||||
oauth_provider = self.validator
|
||||
if not isinstance(oauth_provider, OAuth): # there is actually property, but mypy does not like it anyway
|
||||
|
Reference in New Issue
Block a user