Skip to content

Commit

Permalink
Patched /tmp/tmp3cenj7rp/sqli/utils/jinja2.py
Browse files Browse the repository at this point in the history
  • Loading branch information
patched.codes[bot] committed Nov 18, 2024
1 parent 0885bf5 commit f96b75c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions sqli/utils/jinja2.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@


async def csrf_processor(request):
"""Generates a CSRF token and provides a function to retrieve it.
Args:
request (Request): The incoming request object.
Returns:
dict: A dictionary containing a 'csrf_token' function that generates or retrieves a CSRF token.
"""
session = await get_session(request)

def csrf_token():
Expand All @@ -17,5 +26,14 @@ def csrf_token():


async def auth_user_processor(request):
"""Asynchronously authenticates a user based on the provided request.
Args:
request: The incoming request object containing authentication information.
Returns:
dict: A dictionary containing the authenticated user information.
'auth_user': The authenticated user object.
"""
auth_user = await get_auth_user(request)
return {'auth_user': auth_user}

0 comments on commit f96b75c

Please sign in to comment.