Browse Source

Prevent infinite redirects that happen sometimes for IDIR users

pull/160/head
Mike Olund 8 years ago
parent
commit
873ed56688
3 changed files with 27 additions and 6 deletions
  1. +20
    -0
      edivorce/apps/core/templates/407.html
  2. +2
    -4
      edivorce/apps/core/urls.py
  3. +5
    -2
      edivorce/apps/core/views/main.py

+ 20
- 0
edivorce/apps/core/templates/407.html View File

@ -0,0 +1,20 @@
{% extends 'base.html' %}
{% block title %}{{ block.super }}: 500 Internal Server Error{% endblock %}
{% block content %}
<h1>Authentication Error Occurred</h1>
<p>Invalid SiteMinder authentication type. Only basic BCeID authentication is supported at this time.</p>
<div style="min-height:200px"></div>
{% endblock %}
{% block formbuttons %}
<!-- no formbuttons -->
{% endblock %}
{% block sidebarNav %}
<!-- no sidebar -->
{% endblock %}
{% block sidebar %}
<!-- no sidebar -->
{% endblock %}

+ 2
- 4
edivorce/apps/core/urls.py View File

@ -9,8 +9,7 @@ urlpatterns = [
# url(r'^guide$', styleguide.guide),
url(r'^api/response$', api.UserResponseHandler.as_view()),
# todo: remove this line once SMGOV headers are working
url(r'^login/headers$', system.headers),
# url(r'^login/headers$', system.headers),
url(r'^login', main.login, name="login"),
url(r'^bceid', localdev.bceid, name="bceid"),
@ -23,8 +22,7 @@ urlpatterns = [
url(r'^health$', system.health),
url(r'^legal', main.legal, name="legal"),
# todo: remove this line once SMGOV headers are working
url(r'^headers$', system.headers),
# url(r'^headers$', system.headers),
url(r'^pdf-form(?P<form_number>[0-9]{1,3}(_we|_claimant1|_claimant2)?)$', pdf.form, name="pdf_form"),
url(r'^prequalification/step_(?P<step>[0-9]{2})$', main.prequalification, name="prequalification"),


+ 5
- 2
edivorce/apps/core/views/main.py View File

@ -109,8 +109,11 @@ def login(request):
# If a user is logged into an IDIR then they can see the login page
# but the SMGOV headers are missing. If this is the case, then log them out
# of their IDIR, and redirect them back to here again....
return redirect(
settings.LOGOUT_URL_TEMPLATE % (settings.PROXY_BASE_URL, settings.FORCE_SCRIPT_NAME[:-1] + '/login'))
if request.GET.get('noretry','') != 'true':
return redirect(settings.LOGOUT_URL_TEMPLATE % (
settings.PROXY_BASE_URL, settings.FORCE_SCRIPT_NAME[:-1] + '/login%3Fnoretry=true'))
else:
return render(request, '407.html')
user, created = __get_bceid_user(request)


Loading…
Cancel
Save