Mock auth
This commit is contained in:
@@ -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