quick hack to not allow duplicate usernames with spaces
This commit is contained in:
parent
74d8dba84c
commit
72e5449a4f
1 changed files with 4 additions and 0 deletions
4
auth.py
4
auth.py
|
@ -21,6 +21,10 @@ def login():
|
|||
conn = ldap.initialize(app.config['LDAP_URL'])
|
||||
conn.start_tls_s()
|
||||
res,code = 'OK', 200
|
||||
# hack!
|
||||
if ' ' in request.form['login']:
|
||||
res, code = 'ERROR', 401
|
||||
return make_response(res, code, { 'Content-Type': 'text/plain' })
|
||||
try:
|
||||
conn.simple_bind_s(app.config['DN_STRING'] % request.form['login'],
|
||||
request.form.get('password', ''))
|
||||
|
|
Loading…
Add table
Reference in a new issue