Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
30549bd7
Commit
30549bd7
authored
Dec 22, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send the user to the login page if registering with a linked but inactive account
parent
a7042ca3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletions
+22
-1
common/djangoapps/third_party_auth/pipeline.py
+9
-0
common/djangoapps/third_party_auth/tests/specs/base.py
+13
-1
No files found.
common/djangoapps/third_party_auth/pipeline.py
View file @
30549bd7
...
...
@@ -536,6 +536,15 @@ def ensure_user_information(
if
is_register_2
and
user_unset
:
return
redirect
(
_create_redirect_url
(
AUTH_DISPATCH_URLS
[
AUTH_ENTRY_REGISTER_2
],
strategy
))
# If the user has a linked account, but has not yet activated
# we should send them to the login page. The login page
# will tell them that they need to activate their account.
if
is_register
and
user_inactive
:
return
redirect
(
_create_redirect_url
(
AUTH_DISPATCH_URLS
[
AUTH_ENTRY_LOGIN
],
strategy
))
if
is_register_2
and
user_inactive
:
return
redirect
(
_create_redirect_url
(
AUTH_DISPATCH_URLS
[
AUTH_ENTRY_LOGIN_2
],
strategy
))
def
_create_redirect_url
(
url
,
strategy
):
""" Given a URL and a Strategy, construct the appropriate redirect URL.
...
...
common/djangoapps/third_party_auth/tests/specs/base.py
View file @
30549bd7
...
...
@@ -689,7 +689,19 @@ class IntegrationTest(testutil.TestCase, test.TestCase):
# social auth.
self
.
assert_social_auth_does_not_exist_for_user
(
created_user
,
strategy
)
# We should be redirected back to the complete page, setting
# Since the user's account is not yet active, we should be redirected to /login
self
.
assert_redirect_to_login_looks_correct
(
actions
.
do_complete
(
request
.
social_strategy
,
social_views
.
_do_login
,
request
.
user
,
None
,
# pylint: disable-msg=protected-access
redirect_field_name
=
auth
.
REDIRECT_FIELD_NAME
)
)
# Activate the user's account
strategy
.
request
.
user
.
is_active
=
True
strategy
.
request
.
user
.
save
()
# Try again. This time, we should be redirected back to the complete page, setting
# the "logged in" cookie for the marketing site.
self
.
assert_logged_in_cookie_redirect
(
actions
.
do_complete
(
request
.
social_strategy
,
social_views
.
_do_login
,
request
.
user
,
None
,
# pylint: disable-msg=protected-access
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment