NotAuthorized/NotAuthenticated redirect doesn't honour settings.LOGIN_URL

Bug #1079444 reported by Kieran Spear
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Kieran Spear

Bug Description

We're using a custom login view as our default auth page, but the HorizonMiddleware exception handler hardcodes the name of the login view as "login". So redirects don't go to our page.

if isinstance(exception, (exceptions.NotAuthorized,
                                  exceptions.NotAuthenticated)):
            auth_url = reverse("login")
[...]
            return shortcuts.redirect(redirect_to)

The django login_required decorator redirects to settings.LOGIN_URL if it is set, and this code should probably do the same.

Kieran Spear (kspear)
Changed in horizon:
assignee: nobody → Kieran Spear (kspear)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/16287

Changed in horizon:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/16287
Committed: http://github.com/openstack/horizon/commit/3fbe68f690f86a9e07d054daafedf980217827e9
Submitter: Jenkins
Branch: master

commit 3fbe68f690f86a9e07d054daafedf980217827e9
Author: Kieran Spear <email address hidden>
Date: Fri Nov 16 17:20:51 2012 +1100

    Honour LOGIN_URL when redirecting to login page

    Currently the redirect is always made to the url of the 'login' view.
    This change makes redirects go to LOGIN_URL, so the default login view
    can be replaced with a view at another url/name.

    Fixes bug 1079444.

    Change-Id: Ib56200679668dd053d3c6ac24807d2a2affc0df8

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
milestone: none → grizzly-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: grizzly-1 → 2013.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.