omab/django-social-auth — Issue #273: Clean partial_pipeline session in auth_process view
Author: janos
Created: 2012-02-27 04:04:08+00:00
State: open

In case that partial_pipeline is saved in session it making a race condition and various bugs depending on user pipeline functions. It looks like that the root cause is the existence of the session data.

One example is with a form for additional data in a middle of pipeline. Similar like in example app. If a user does not complete the registration process and wants to authenticate with a different backend, there is a race condition (and/or one bug related to multiple keyword argument `pipeline_index` in calling backend.continue_pipeline in auth_complete in views.py).

It would be expected to clean partial_pipeline session on starting new authentication. One of the solutions is to add:

```python
try:
del request.session[setting('SOCIAL_AUTH_PARTIAL_PIPELINE_KEY',
'partial_pipeline')]
except KeyError:
pass
```

to `auth_process` in views.py.

Best,
Janos