Jinja2 fix, JFHR support, template.render() bypass for cache bug
This commit is contained in:
0
.env.example
Normal file → Executable file
0
.env.example
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
0
.idea/.gitignore
generated
vendored
Normal file → Executable file
0
.idea/.gitignore
generated
vendored
Normal file → Executable file
0
.idea/misc.xml
generated
Normal file → Executable file
0
.idea/misc.xml
generated
Normal file → Executable file
0
.idea/modules.xml
generated
Normal file → Executable file
0
.idea/modules.xml
generated
Normal file → Executable file
0
.idea/unifi-guest-portal.iml
generated
Normal file → Executable file
0
.idea/unifi-guest-portal.iml
generated
Normal file → Executable file
0
.idea/vcs.xml
generated
Normal file → Executable file
0
.idea/vcs.xml
generated
Normal file → Executable file
0
Dockerfile
Normal file → Executable file
0
Dockerfile
Normal file → Executable file
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."
|
"message": "Failed to authorize your device. Please try again or ask for help."
|
||||||
})
|
})
|
||||||
|
|
||||||
return templates.TemplateResponse("success.html", {
|
|
||||||
"request": request,
|
try:
|
||||||
"site": site,
|
template = templates.env.get_template("success.html")
|
||||||
"userinfo": userinfo,
|
html = template.render(
|
||||||
"duration_hours": duration // 60,
|
request=request,
|
||||||
"original_url": original_url,
|
site={"id": site.id, "name": site.name},
|
||||||
"user_agent": user_agent,
|
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
0
docker-compose.yml
Normal file → Executable file
0
docker-compose.yml
Normal file → Executable file
0
nginx.conf
Normal file → Executable file
0
nginx.conf
Normal file → Executable file
0
requirements.txt
Normal file → Executable file
0
requirements.txt
Normal file → Executable file
Reference in New Issue
Block a user