🐛 maybe_authenticated with export
This commit is contained in:
parent
d7f7db338f
commit
cf106e8855
2 changed files with 2 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
from .routes import (
|
||||
get_current_user,
|
||||
get_token,
|
||||
maybe_authenticated,
|
||||
require_admin,
|
||||
require_authenticated,
|
||||
require_group,
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ async def get_current_user(token: str = Depends(oauth2_scheme)) -> User:
|
|||
return user
|
||||
|
||||
|
||||
async def optionally_authenticated(token: Optional[str] = Depends(oauth2_scheme)) -> Optional[User]:
|
||||
async def maybe_authenticated(token: Optional[str] = Depends(oauth2_scheme)) -> Optional[User]:
|
||||
if token is None:
|
||||
return None
|
||||
return await get_current_user(token)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue