Changeset - 436de322df81
[Not reviewed]
default
0 1 0
Dennis Fink - 10 years ago 2015-07-07 19:37:30

Add the possibility to specify more users
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
spaceapi/auth.py
Show inline comments
 
@@ -2,9 +2,9 @@ from flask import current_app
 
from flask.ext.httpauth import HTTPDigestAuth
 

	
 
httpauth = HTTPDigestAuth()
 

	
 
@httpauth.get_password
 
def get_pw(username):
 
    if username == current_app.config.get('HTTP_DIGEST_AUTH_USER'):
 
        return current_app.config.get('HTTP_DIGEST_AUTH_PASSWORD')
 
    if username is in current_app.config['HTTP_DIGEST_AUTH_USERS']:
 
        return current_app.config['HTTP_DIGEST_AUTH_USERS'][username]
 
    return None
0 comments (0 inline, 0 general)