mirror of
https://github.com/creyD/creyPY.git
synced 2026-04-13 11:50:31 +02:00
13 lines
407 B
Python
13 lines
407 B
Python
from fastapi import HTTPException, status
|
|
|
|
|
|
class UnauthorizedException(HTTPException):
|
|
def __init__(self, detail: str, **kwargs):
|
|
"""Returns HTTP 403"""
|
|
super().__init__(status.HTTP_403_FORBIDDEN, detail=detail)
|
|
|
|
|
|
class UnauthenticatedException(HTTPException):
|
|
def __init__(self):
|
|
super().__init__(status_code=status.HTTP_401_UNAUTHORIZED, detail="Requires authentication")
|