Merge lp:~salgado/launchpad/bug-527985 into lp:launchpad

Proposed by Guilherme Salgado
Status: Merged
Approved by: Gary Poster
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~salgado/launchpad/bug-527985
Merge into: lp:launchpad
Diff against target: 42 lines (+19/-0)
2 files modified
lib/canonical/launchpad/browser/launchpad.py (+6/-0)
lib/canonical/launchpad/doc/loginstatus-pages.txt (+13/-0)
To merge this branch: bzr merge lp:~salgado/launchpad/bug-527985
Reviewer Review Type Date Requested Status
Tim Penhey (community) release-critical Approve
Gary Poster (community) Approve
Review via email: mp+20392@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Guilherme Salgado (salgado) wrote :

When the user doesn't authorize the OpenID provider to send their
details to the RP, the user will end up at the +openid-callback page,
which has a login link.

Currently, the link will be something like /+openid-callback/+login,
which causes LP to believe the user wants to be sent to +openid-callback
once the login is completed, but that's obviously not true -- that was
just a page the user ended up at after a failed login. The fix here
will just drop the /+openid-callback bit from the login link, similarly
to what we already do for the +logout page.

Revision history for this message
Gary Poster (gary) wrote :

Thanks, Salgado!

review: Approve
Revision history for this message
Tim Penhey (thumper) :
review: Approve (release-critical)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/browser/launchpad.py'
2--- lib/canonical/launchpad/browser/launchpad.py 2010-02-23 19:40:45 +0000
3+++ lib/canonical/launchpad/browser/launchpad.py 2010-03-01 19:52:20 +0000
4@@ -474,8 +474,14 @@
5 if full_url.endswith('/'):
6 full_url = full_url[:-1]
7 logout_url_end = '/+logout'
8+ openid_callback_url_end = '/+openid-callback'
9 if full_url.endswith(logout_url_end):
10 full_url = full_url[:-len(logout_url_end)]
11+ elif full_url.endswith(openid_callback_url_end):
12+ full_url = full_url[:-len(openid_callback_url_end)]
13+ else:
14+ # No need to remove anything from full_url.
15+ pass
16 return '%s/+login%s' % (full_url, query_string)
17
18
19
20=== modified file 'lib/canonical/launchpad/doc/loginstatus-pages.txt'
21--- lib/canonical/launchpad/doc/loginstatus-pages.txt 2009-08-13 13:33:26 +0000
22+++ lib/canonical/launchpad/doc/loginstatus-pages.txt 2010-03-01 19:52:20 +0000
23@@ -81,6 +81,19 @@
24 >>> status.login_url
25 'http://localhost/+login'
26
27+The +openid-callback page.
28+
29+ >>> request = DummyRequest(
30+ ... 'http://localhost', '/+openid-callback', '')
31+ >>> context = object()
32+ >>> status = LoginStatus(context, request)
33+ >>> status.logged_in
34+ False
35+ >>> status.login_shown
36+ True
37+ >>> status.login_url
38+ 'http://localhost/+login'
39+
40 Logging in.
41
42 >>> login('foo.bar@canonical.com')