-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(headless): Connect third-party account vs HEADLESS_ONLY
- Loading branch information
Showing
7 changed files
with
84 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
from django.http import HttpResponseRedirect | ||
from django.urls import reverse | ||
|
||
from allauth.account.authentication import record_authentication | ||
|
||
|
||
STATE_SESSION_KEY = "account_reauthentication_state" | ||
|
||
|
||
def reauthenticate_by_password(request): | ||
record_authentication(request, method="password", reauthenticated=True) | ||
|
||
|
||
def stash_and_reauthenticate(request, state, callback): | ||
request.session[STATE_SESSION_KEY] = { | ||
"state": state, | ||
"callback": callback, | ||
} | ||
return HttpResponseRedirect(reverse("account_reauthenticate")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters