Skip to content

Commit

Permalink
Fix redirects to new client side route
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Dec 12, 2017
1 parent e942e4b commit 87777cf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 21 deletions.
34 changes: 14 additions & 20 deletions lib/galaxy/webapps/galaxy/controllers/user.py
Expand Up @@ -139,8 +139,10 @@ def openid_process(self, trans, **kwd):
return trans.show_error_message('OpenID authentication is not enabled in this instance of Galaxy')
auto_associate = util.string_as_bool(kwd.get('auto_associate', False))
action = 'login'
controller = 'user'
if trans.user:
action = 'openid_manage'
action = 'openids'
controller = 'list'
if trans.app.config.support_url is not None:
contact = '<a href="%s">support</a>' % trans.app.config.support_url
else:
Expand All @@ -154,7 +156,7 @@ def openid_process(self, trans, **kwd):
openid_provider = kwd.get('openid_provider', None)
if info.status == trans.app.openid_manager.FAILURE and display_identifier:
message = "Login via OpenID failed. The technical reason for this follows, please include this message in your email if you need to %s to resolve this problem: %s" % (contact, info.message)
return trans.response.send_redirect(url_for(controller='user',
return trans.response.send_redirect(url_for(controller=controller,
action=action,
use_panels=True,
redirect=redirect,
Expand Down Expand Up @@ -209,8 +211,8 @@ def openid_process(self, trans, **kwd):
message = '%s<br>Click <a href="%s"><strong>here</strong></a> to return to the page you were previously viewing.' % (message, escape(self.__get_redirect_url(redirect)))
if redirect and status != "error":
return trans.response.send_redirect(self.__get_redirect_url(redirect))
return trans.response.send_redirect(url_for(controller='user',
action='openid_manage',
return trans.response.send_redirect(url_for(controller='openids',
action='list',
use_panels=True,
redirect=redirect,
message=message,
Expand Down Expand Up @@ -301,18 +303,14 @@ def openid_associate(self, trans, cntrller='user', **kwd):
for openid in openid_objs:
message = '%s<li><a href="%s" target="_blank">%s</a></li>' % (message, url_for(controller='user', action='openid_auth', openid_provider=openid.id, redirect=redirect, auto_associate=True), openid.name)
message = "%s</ul>" % (message)
return trans.response.send_redirect(url_for(controller='user',
action='openid_manage',
use_panels=use_panels,
redirect=redirect,
return trans.response.send_redirect(url_for(controller='openids',
action='list',
message=message,
status='info'))
if redirect:
return trans.response.send_redirect(redirect)
return trans.response.send_redirect(url_for(controller='user',
action='openid_manage',
use_panels=use_panels,
redirect=redirect,
return trans.response.send_redirect(url_for(controller='openids',
action='list',
message=message,
status='info'))
if kwd.get('create_user_button', False):
Expand Down Expand Up @@ -353,18 +351,14 @@ def openid_associate(self, trans, cntrller='user', **kwd):
for openid in openid_objs:
message = '%s<li><a href="%s" target="_blank">%s</a></li>' % (message, url_for(controller='user', action='openid_auth', openid_provider=openid.id, redirect=redirect, auto_associate=True), openid.name)
message = "%s</ul>" % (message)
return trans.response.send_redirect(url_for(controller='user',
action='openid_manage',
use_panels=True,
redirect=redirect,
return trans.response.send_redirect(url_for(controller='openids',
action='list',
message=message,
status='info'))
if redirect:
return trans.response.send_redirect(redirect)
return trans.response.send_redirect(url_for(controller='user',
action='openid_manage',
use_panels=use_panels,
redirect=redirect,
return trans.response.send_redirect(url_for(controller='openids',
action='list',
message=message,
status='info'))
else:
Expand Down
2 changes: 1 addition & 1 deletion templates/user/index.mako
Expand Up @@ -16,7 +16,7 @@
<li><a href="${h.url_for( controller='user', action='api_keys', cntrller=cntrller )}">${_('Manage your API keys')}</a></li>
<li><a href="${h.url_for( controller='user', action='toolbox_filters', cntrller=cntrller )}">${_('Manage your ToolBox filters')}</a></li>
%if trans.app.config.enable_openid and not trans.app.config.use_remote_user:
<li><a href="${h.url_for( controller='user', action='openid_manage', cntrller=cntrller )}">${_('Manage OpenIDs')}</a> linked to your account</li>
<li><a href="${h.url_for( controller='openids', action='list' )}">${_('Manage OpenIDs')}</a> linked to your account</li>
%endif
<li><a href="${h.url_for( controller='user', action='logout', logout_all=True )}" target="_top">${_('Logout')}</a> ${_('of all user sessions')}</li>
%else:
Expand Down

0 comments on commit 87777cf

Please sign in to comment.