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
=== modified file 'lib/canonical/launchpad/browser/launchpad.py'
--- lib/canonical/launchpad/browser/launchpad.py 2010-02-23 19:40:45 +0000
+++ lib/canonical/launchpad/browser/launchpad.py 2010-03-01 19:52:20 +0000
@@ -474,8 +474,14 @@
474 if full_url.endswith('/'):474 if full_url.endswith('/'):
475 full_url = full_url[:-1]475 full_url = full_url[:-1]
476 logout_url_end = '/+logout'476 logout_url_end = '/+logout'
477 openid_callback_url_end = '/+openid-callback'
477 if full_url.endswith(logout_url_end):478 if full_url.endswith(logout_url_end):
478 full_url = full_url[:-len(logout_url_end)]479 full_url = full_url[:-len(logout_url_end)]
480 elif full_url.endswith(openid_callback_url_end):
481 full_url = full_url[:-len(openid_callback_url_end)]
482 else:
483 # No need to remove anything from full_url.
484 pass
479 return '%s/+login%s' % (full_url, query_string)485 return '%s/+login%s' % (full_url, query_string)
480486
481487
482488
=== modified file 'lib/canonical/launchpad/doc/loginstatus-pages.txt'
--- lib/canonical/launchpad/doc/loginstatus-pages.txt 2009-08-13 13:33:26 +0000
+++ lib/canonical/launchpad/doc/loginstatus-pages.txt 2010-03-01 19:52:20 +0000
@@ -81,6 +81,19 @@
81 >>> status.login_url81 >>> status.login_url
82 'http://localhost/+login'82 'http://localhost/+login'
8383
84The +openid-callback page.
85
86 >>> request = DummyRequest(
87 ... 'http://localhost', '/+openid-callback', '')
88 >>> context = object()
89 >>> status = LoginStatus(context, request)
90 >>> status.logged_in
91 False
92 >>> status.login_shown
93 True
94 >>> status.login_url
95 'http://localhost/+login'
96
84Logging in.97Logging in.
8598
86 >>> login('foo.bar@canonical.com')99 >>> login('foo.bar@canonical.com')