Skip to content

Bug in discord oauth2 processing #1

@enigmathix

Description

@enigmathix

In puzzle_editing/views.py:

@login_required
def oauth2_link(request):
(...)
        # if 'state' in request.GET and 'session' in request.session and request.GET['state'] == request.session['discord_state']:
        # handles the discord oauth_callback
        del request.session["discord_state"]

It looks like half the code was commented out with a typo in it (it should be 'discord_state' instead of 'session'), and as a result, the del throws an exception if discord_state is not in request session. I think it should be:

        # handles the discord oauth_callback
        if 'state' in request.GET and 'discord_state' in request.session and request.GET['state'] == request.session['discord_state']:
                del request.session["discord_state"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions