From 8985eecfeac5887f59fdf36d9b3f2584692ff5ed Mon Sep 17 00:00:00 2001 From: Parker Date: Sun, 10 Nov 2024 23:11:17 -0600 Subject: Add log routes and update dashboard --- api/routes/auth_routes.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'api/routes/auth_routes.py') 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} -- cgit v1.2.3-70-g09d2