Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Social login: GET method not supported #598

Open
jonasN5 opened this issue Mar 14, 2024 · 0 comments
Open

Social login: GET method not supported #598

jonasN5 opened this issue Mar 14, 2024 · 0 comments

Comments

@jonasN5
Copy link

jonasN5 commented Mar 14, 2024

Login with Twitch doesn't work because the callback with the authorization code is a GET request, which raises:
django all auth save() prohibited to prevent data loss due to unsaved related object 'app'.

I patched it like so:

class TwitchLogin(SocialLoginView):
    adapter_class = TwitchOAuth2Adapter
    # callback_url = 'http://127.0.0.1:8080/accounts/twitch/login/callback/'
    callback_url = 'http://localhost:8080/accounts/twitch/'
    client_class = OAuth2Client

    def get(self, request, *args, **kwargs):
        request.data['code'] = request.query_params['code']
        return self.post(request, *args, **kwargs)

Still, GET requests should be supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant