Browse Source

Added a password to the login form, just in case anyone from the general public discovers the dev server before bceid is fully configured

pull/160/head
Mike Olund 8 years ago
parent
commit
32c77ef9d1
2 changed files with 7 additions and 1 deletions
  1. +1
    -1
      edivorce/apps/core/templates/localdev/bceid.html
  2. +6
    -0
      edivorce/apps/core/views/localdev.py

+ 1
- 1
edivorce/apps/core/templates/localdev/bceid.html View File

@ -35,7 +35,7 @@
<header id="bcGov" class="no-gov-brand">
<div class="container">
<div class="seperator"></div>
<div id="login-to" class="site-title">Log in to justice.gov.bc.ca/divorce</div>
<div id="login-to" class="site-title">FAKE BCeID LOGIN &ndash; FOR SOFTWARE DEVELOPMENT PURPOSES ONLY</div>
</div>
</header>


+ 6
- 0
edivorce/apps/core/views/localdev.py View File

@ -11,6 +11,12 @@ def bceid(request):
""" fake bceid login for developer workstation environment """
if request.method == "POST":
login_name = request.POST.get('user', '')
password = request.POST.get('password', '')
# just in case anyone from the general public discovers the dev server
# make sure they don't accidentally login and think this is production
if password.lower() != 'divorce':
return redirect(settings.FORCE_SCRIPT_NAME[:-1] + '/bceid')
# convert the login name to a guid
hex_name = decode(binascii.hexlify(str.encode(login_name)))[0]


Loading…
Cancel
Save