Redirect initial hit to login page
By rendering the login page within the GET / path we cannot trap the /auth location from horizon to allow us to setup kerberos and other REMOTE_USER tasks on that path. On initial unauthenticated request redirect the user to /auth/login. Change-Id: Ibe577672fc67a33460ea5d8726925b7e4b2a65e9 Closes-Bug: #1418440
This commit is contained in:
parent
c30ff07a53
commit
f9ceb2d86a
|
@ -17,8 +17,7 @@ import django.views.decorators.vary
|
||||||
|
|
||||||
import horizon
|
import horizon
|
||||||
from horizon import base
|
from horizon import base
|
||||||
|
from horizon import exceptions
|
||||||
from openstack_auth import forms
|
|
||||||
|
|
||||||
|
|
||||||
def get_user_home(user):
|
def get_user_home(user):
|
||||||
|
@ -37,11 +36,10 @@ def get_user_home(user):
|
||||||
|
|
||||||
@django.views.decorators.vary.vary_on_cookie
|
@django.views.decorators.vary.vary_on_cookie
|
||||||
def splash(request):
|
def splash(request):
|
||||||
if request.user.is_authenticated():
|
if not request.user.is_authenticated():
|
||||||
response = shortcuts.redirect(horizon.get_user_home(request.user))
|
raise exceptions.NotAuthenticated()
|
||||||
else:
|
|
||||||
form = forms.Login(request)
|
response = shortcuts.redirect(horizon.get_user_home(request.user))
|
||||||
response = shortcuts.render(request, 'auth/login.html', {'form': form})
|
|
||||||
if 'logout_reason' in request.COOKIES:
|
if 'logout_reason' in request.COOKIES:
|
||||||
response.delete_cookie('logout_reason')
|
response.delete_cookie('logout_reason')
|
||||||
return response
|
return response
|
||||||
|
|
Loading…
Reference in New Issue