Skip to content

Commit 7c49f5c

Browse files
Fix NameError: oauth_check not defined in render_login()
The render_login() function was referencing oauth_check without defining it, causing a 500 Internal Server Error whenever the login page was accessed. Added oauth_check initialization from oauth_bb.oauth_check before rendering the login template, with fallback to empty dict when OAuth is not available. Error message: NameError: name 'oauth_check' is not defined. Did you mean: 'health_check'? This bug was present regardless of OAuth configuration and would affect any user accessing the login page. Fixes: Discord user report of 500 error on login page
1 parent 53bf2f5 commit 7c49f5c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

cps/web.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,6 +1952,9 @@ def render_login(username="", password=""):
19521952
if url_for("web.logout") == next_url:
19531953
next_url = url_for("web.index")
19541954

1955+
# Get OAuth check status
1956+
oauth_check = oauth_bb.oauth_check if feature_support['oauth'] else {}
1957+
19551958
# Get generic OAuth login button text for display
19561959
generic_login_button = None
19571960
if feature_support['oauth']:

0 commit comments

Comments
 (0)