Mock auth
This commit is contained in:
1 parent
851906a029
commit
e0f8112d13
7 files changed
+66
-18
No files matched your search
@@ -0,0 +1,9 @@
|
||||
from fastapi import HTTPException, status
|
||||
|
||||
|
||||
class BaseError(HTTPException):
|
||||
status_code: int = status.HTTP_500_INTERNAL_SERVER_ERROR
|
||||
|
||||
def __init__(self, detail: str):
|
||||
self.detail = detail
|
||||
super().__init__(status_code=self.status_code, detail=self.detail)
|
||||
@@ -0,0 +1,10 @@
|
||||
from fastapi import status
|
||||
|
||||
from .base_error import BaseError
|
||||
|
||||
|
||||
class NotAuthenticatedError(BaseError):
|
||||
status_code: int = status.HTTP_401_UNAUTHORIZED
|
||||
|
||||
def __init__(self):
|
||||
super().__init__("Not authenticated")
|
||||
Reference in new issue
Block a user