fix: update legacy web routes to use slug instead of username
- Fix /dashboard route to use current_user.slug for service_url - Fix /container/restart route to pass current_user.slug to spawn_container() - Ensures legacy Flask-Login routes work with passwordless authentication
This commit is contained in:
parent
b116d74f84
commit
016ec933e6
4
app.py
4
app.py
|
|
@ -83,7 +83,7 @@ def dashboard():
|
|||
# Service-URL für den User (pfad-basiert)
|
||||
scheme = app.config['PREFERRED_URL_SCHEME']
|
||||
spawner_domain = f"{app.config['SPAWNER_SUBDOMAIN']}.{app.config['BASE_DOMAIN']}"
|
||||
service_url = f"{scheme}://{spawner_domain}/{current_user.username}"
|
||||
service_url = f"{scheme}://{spawner_domain}/{current_user.slug}"
|
||||
|
||||
return render_template('dashboard.html',
|
||||
user=current_user,
|
||||
|
|
@ -103,7 +103,7 @@ def restart_container():
|
|||
|
||||
# Neuen Container starten
|
||||
try:
|
||||
container_id, port = container_mgr.spawn_container(current_user.id, current_user.username)
|
||||
container_id, port = container_mgr.spawn_container(current_user.id, current_user.slug)
|
||||
current_user.container_id = container_id
|
||||
current_user.container_port = port
|
||||
db.session.commit()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user