diff options
author | Parker <contact@pkrm.dev> | 2024-11-10 23:11:17 -0600 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-11-10 23:11:17 -0600 |
commit | 8985eecfeac5887f59fdf36d9b3f2584692ff5ed (patch) | |
tree | 908b05eacbad8def836dae7ccf67c534675bb912 /api/routes/auth_routes.py | |
parent | 691aa744a0398f185b3ca98a36fbd83806c7786c (diff) |
Add log routes and update dashboard
Diffstat (limited to 'api/routes/auth_routes.py')
-rw-r--r-- | api/routes/auth_routes.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/api/routes/auth_routes.py b/api/routes/auth_routes.py index c51557f..24e1391 100644 --- a/api/routes/auth_routes.py +++ b/api/routes/auth_routes.py @@ -7,8 +7,10 @@ from typing import Annotated from api.util.authentication import ( create_access_token, authenticate_user, + get_current_user, ) from api.util.db_dependency import get_db +from api.schemas.auth_schemas import User router = APIRouter(prefix="/auth", tags=["auth"]) @@ -44,3 +46,14 @@ async def login_for_access_token( # secure=True, # Cookies are only sent over HTTPS ) return response + + +# Check if the user is logged in +@router.get("/check", summary="Check if the user is logged in") +async def check_login( + current_user: Annotated[User, Depends(get_current_user)], +): + """ + If the user actually makes it to this endpoint, they are logged in + """ + return {"success": True} |