Skip to content

Bug: Undefined names _do_login and REDIRECT_FIELD_NAME in [users/views.py] cause NameError on OAuth callback #131

@qzMalekuz

Description

@qzMalekuz

The complete() function in [users/views.py] (https://github.com/cytoscape/appstore/blob/master/users/views.py) references two symbols — _do_login and REDIRECT_FIELD_NAME — that are never imported or defined anywhere in the file. This will raise a NameError at runtime.

Affected Code :-
Image

Both _do_login and REDIRECT_FIELD_NAME are used but never imported at the top of the file.

Impact -

  • Severity: High

  • The login_done() view (line 31) calls complete() or authenticated users. Any already-logged-in user who hits the OAuth callback will trigger this code path, resulting in a 500 Internal Server Error.

  • Unauthenticated users are unaffected because they take a different branch in login_done().

Steps to Reproduce :-

  • Log in to the App Store as any user.
  • Initiate an OAuth login flow again (e.g., click "Sign in with Google" while already authenticated).
  • The server returns a 500 error due to NameError: name '_do_login' is not defined.

Proposed Fix
Add the missing imports to the top of users/views.py :-

Image

I'd be happy to submit a PR for this fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions