social-core icon indicating copy to clipboard operation
social-core copied to clipboard

AuthMissingParameter caused by cleaning up the wrong Partial

Open jaywhy13 opened this issue 6 years ago • 0 comments

Expected behaviour

When there are multiple partial functions in the pipeline, the pipeline should seamlessly save the partial_token on the session without requiring the partial_token to be passed around on every request to the /complete/<backend> endpoint.

Actual behaviour

The clean up process of the partial_token removes the previous token from the database but removes the current partial_token because it doesn't check which token is saved on the session. The partial_token for the current partial is saved before the cleanup of the old token happens.

What are the steps to reproduce this issue?

  1. Check out this branch of the social-examples repo.

  2. Add the SOCIAL_AUTH_GOOGLE_OAUTH2_KEY and SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET to example-django/example/settings.py. This branch edits the home.html template so it does not pass up the partial_token to the complete/<backend> endpoint.

  3. Connect a non-work Google Account (I think this is necessary to be prompted for Country and City)

  4. It should redirect the user and ask for Country. Fill this in.

  5. It should redirect the user and ask for City. Fill this in.

  6. AuthMissingParameter error happens.

I added lots more context for this issue in my PR here.

jaywhy13 avatar Apr 22 '20 18:04 jaywhy13