Jinja2 fix, JFHR support, template.render() bypass for cache bug
This commit is contained in:
0
app/__init__.py
Normal file → Executable file
0
app/__init__.py
Normal file → Executable file
0
app/auth.py
Normal file → Executable file
0
app/auth.py
Normal file → Executable file
0
app/config.py
Normal file → Executable file
0
app/config.py
Normal file → Executable file
24
app/main.py
Normal file → Executable file
24
app/main.py
Normal file → Executable file
@@ -114,11 +114,19 @@ async def callback(request: Request, code: str, state: str):
|
||||
"message": "Failed to authorize your device. Please try again or ask for help."
|
||||
})
|
||||
|
||||
return templates.TemplateResponse("success.html", {
|
||||
"request": request,
|
||||
"site": site,
|
||||
"userinfo": userinfo,
|
||||
"duration_hours": duration // 60,
|
||||
"original_url": original_url,
|
||||
"user_agent": user_agent,
|
||||
})
|
||||
|
||||
try:
|
||||
template = templates.env.get_template("success.html")
|
||||
html = template.render(
|
||||
request=request,
|
||||
site={"id": site.id, "name": site.name},
|
||||
userinfo=userinfo,
|
||||
duration_hours=duration // 60,
|
||||
original_url=original_url,
|
||||
user_agent=user_agent,
|
||||
)
|
||||
return HTMLResponse(html)
|
||||
except Exception as e:
|
||||
logger.error("Success template error: %s", str(e))
|
||||
return RedirectResponse(original_url or "http://captive.apple.com/hotspot-detect.html")
|
||||
|
||||
|
||||
0
app/static/pup.jpg
Normal file → Executable file
0
app/static/pup.jpg
Normal file → Executable file
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
0
app/templates/base.html
Normal file → Executable file
0
app/templates/base.html
Normal file → Executable file
0
app/templates/enroll-success.html
Normal file → Executable file
0
app/templates/enroll-success.html
Normal file → Executable file
0
app/templates/error.html
Normal file → Executable file
0
app/templates/error.html
Normal file → Executable file
0
app/templates/success.html
Normal file → Executable file
0
app/templates/success.html
Normal file → Executable file
0
app/unifi.py
Normal file → Executable file
0
app/unifi.py
Normal file → Executable file
Reference in New Issue
Block a user