From f7862bc54a19f1cdb14a6cc76474165f35381e4d Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Wed, 10 Jun 2026 12:50:51 -0400 Subject: [PATCH] feat(profile): let guests manage their localStorage username /profile previously required auth and returned a raw JSON 401 for guests. Now it renders a guest variant: edit guestUsername in localStorage, clear it to re-prompt on next visit, or sign in to claim a permanent username. Unifies the two username flows (authed DB display_name vs guest localStorage) under one page. --- app.py | 3 +- templates/profile.html | 83 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 80 insertions(+), 6 deletions(-) diff --git a/app.py b/app.py index 30b990b..22ca69a 100644 --- a/app.py +++ b/app.py @@ -884,9 +884,8 @@ def logout(): @app.route("/profile") -@auth.require_auth def profile_page(): - """Profile settings page""" + """Profile settings page — works for both authenticated users and guests.""" user = auth.get_current_user() return render_template("profile.html", user=user) diff --git a/templates/profile.html b/templates/profile.html index 9af8848..fab5423 100644 --- a/templates/profile.html +++ b/templates/profile.html @@ -269,14 +269,19 @@
🏠 Home 📋 Browse Rooms + {% if user %} + {% else %} + 🔐 Sign In + {% endif %}

Manage your account preferences

- + {% if user %} +

Change Username

@@ -299,6 +304,36 @@
+ {% else %} + +
+

Guest Name

+

+ You're browsing as a guest. Your name is stored in your browser only. + Sign in to claim a permanent username. +

+
+ Current guest name: (none) +
+
+
+
+ + +
+ +
+ +
+ {% endif %}
@@ -317,9 +352,6 @@