User Log and Persistent Faction Information
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
"""Authentication utilities and dependencies."""
|
||||
#Authentication utilities and dependencies
|
||||
import jwt
|
||||
from fastapi import Request, HTTPException
|
||||
import config as config_module
|
||||
|
||||
|
||||
def get_current_user(request: Request) -> dict:
|
||||
"""Dependency to check authentication and return user info"""
|
||||
#Dependency to check authentication and return user info
|
||||
token = request.cookies.get("auth_token")
|
||||
|
||||
if not token:
|
||||
@@ -21,7 +21,7 @@ def get_current_user(request: Request) -> dict:
|
||||
|
||||
|
||||
def check_auth(request: Request) -> bool:
|
||||
"""Check if user is authenticated (returns bool, doesn't raise exception)"""
|
||||
#Check if user is authenticated (returns bool, doesn't raise exception)
|
||||
token = request.cookies.get("auth_token")
|
||||
if not token:
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user