Added access tokens for duplicates
This commit is contained in:
@@ -81,6 +81,13 @@ async def user_already_exists_exception_handler(request: Request, exc: UserAlrea
|
||||
content={"detail": "User with this username already exists."},
|
||||
)
|
||||
|
||||
@app.exception_handler(AccessTokenInvalidError)
|
||||
async def access_token_invalid_exception_handler(request: Request, exc: AccessTokenInvalidError):
|
||||
return UJSONResponse(
|
||||
status_code=HTTP_401_UNAUTHORIZED,
|
||||
content={"detail": "Invalid access token."},
|
||||
)
|
||||
|
||||
@app.exception_handler(UserCredentialsInvalid)
|
||||
async def user_credentials_invalid_exception_handler(request: Request, exc: UserCredentialsInvalid):
|
||||
return UJSONResponse(
|
||||
|
Reference in New Issue
Block a user