Browse Source

Fixed bug with users who are already logged into IDIR

pull/160/head
Mike Olund 8 years ago
parent
commit
c9ccc1b4a6
5 changed files with 7 additions and 40 deletions
  1. +0
    -8
      edivorce/apps/core/urls.py
  2. +5
    -1
      edivorce/apps/core/views/main.py
  3. +0
    -2
      edivorce/settings/base.py
  4. +2
    -1
      edivorce/settings/openshift.py
  5. +0
    -28
      setup.py

+ 0
- 8
edivorce/apps/core/urls.py View File

@ -8,10 +8,6 @@ handler500 = 'core.views.main.server_error'
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', main.login, name="login"),
url(r'^bceid', localdev.bceid, name="bceid"),
url(r'^register$', main.register, name="register"),
@ -22,10 +18,6 @@ urlpatterns = [
url(r'^dashboard/(?P<nav_step>.*)', main.dashboard_nav, name="dashboard_nav"),
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'^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"),
url(r'^question/(?P<step>.*)$', main.question, name="question_steps"),


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

@ -105,7 +105,11 @@ def login(request):
guid = request.bceid_user.guid
if guid is None:
return render(request, 'localdev/debug.html')
# 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'))
user, created = __get_bceid_user(request)


+ 0
- 2
edivorce/settings/base.py View File

@ -28,8 +28,6 @@ SECRET_KEY = os.environ.get(
DEBUG = False
# TODO: Set ALLOWED_HOSTS this to the actual host headers used by the local/dev/test/prod instances & health probes
# ALLOWED_HOSTS = ['localhost', '127.0.0.1']
ALLOWED_HOSTS = ['*']
# Application definition


+ 2
- 1
edivorce/settings/openshift.py View File

@ -73,7 +73,8 @@ WEASYPRINT_CSS_LOOPBACK += PROXY_URL_PREFIX
# Integration URLs
PROXY_BASE_URL = 'https://justice.gov.bc.ca'
LOGOUT_URL = 'https://logon.gov.bc.ca/clp-cgi/logoff.cgi?returl=%s%s&retnow=1' % (PROXY_BASE_URL, PROXY_URL_PREFIX)
LOGOUT_URL_TEMPLATE = 'https://logon.gov.bc.ca/clp-cgi/logoff.cgi?returl=%s%s&retnow=1'
LOGOUT_URL = LOGOUT_URL_TEMPLATE % (PROXY_BASE_URL, PROXY_URL_PREFIX)
# Basic Authentication to prevent anyone from accidentally stumbling across publicly accessible dev/test environments
BASICAUTH_ENABLED = os.getenv('BASICAUTH_ENABLED', '').lower() == 'true'


+ 0
- 28
setup.py View File

@ -1,28 +0,0 @@
#!/usr/bin/env python
# NOTE: this isn't a real setup.py file. It has been added here
# so additional steps could be injected into the OpenShift/Docker S2I build.
#
# If a file called "setup.py" exists, then the S2I assemble script will run it
# during the build.
#
# TODO: I have added Django-Compressor code to wsgi.py so it runs during deployment
# instead. I'm just keeping the code here until I am sure the other approach
# is working. This script currently does NOTHING
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "edivorce.settings.openshift")
from django.core.management import execute_from_command_line
print('')
print('NOTICE: THIS SCRIPT DOES NOT SET UP THE PROJECT!!')
print('If you are trying to set up the project, please run the following command instead:')
print('$ pip install -r requirements.txt')
print('')
print('Executing additional OpenShift S2I assemble tasks defined in setup.py')
print('')
# Run Django-Compressor offline compression
# print('Running Django Compressor offline compression')
# execute_from_command_line(['manage.py', 'compress'])

Loading…
Cancel
Save