Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /yaroslaff_fastapi-simple-auth /fastapi_simple_auth /views /settingsjs.py
| import json | |
| from fastapi import APIRouter, Request, Response | |
| from fastapi.responses import HTMLResponse | |
| from ..router import auth_router | |
| from ..settings import settings | |
| def settings_view(rq: Request): | |
| path_parts = rq.url.path.split('/') | |
| path = '/'.join(path_parts[:-1]) | |
| data = { | |
| 'base_url': path, | |
| 'username_is_email': settings.username_is_email, | |
| 'signin_after_signup': settings.signin_after_signup, | |
| 'afterlogin_url': settings.afterlogin_url, | |
| 'afterlogout_url': settings.afterlogout_url, | |
| 'turnstile_sitekey': settings.turnstile_sitekey, | |
| } | |
| js_content = f""" | |
| const settings = {json.dumps(data)}; | |
| sessionStorage.setItem("simpleAuthSettings", JSON.stringify(settings)); | |
| """ | |
| response = Response(content=js_content, media_type="application/javascript") | |
| return response | |
Xet Storage Details
- Size:
- 900 Bytes
- Xet hash:
- 0291040bc9330122bf160e0dbfd8bf408fc70c63f55ca1e2f7bfa5bca339ca6d
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.