diff --git a/user_managment/application.py b/user_managment/application.py index e0e0c71..e536083 100644 --- a/user_managment/application.py +++ b/user_managment/application.py @@ -20,11 +20,20 @@ def gen(): #content = Markup('The HTML String') user_id = request.args.get('user_id') print(user_id) - auth_dict[int(user_id)] = '' - content = ''' + print(request.args.get('mode')) + if request.args.get('mode') == 'generated': + auth_dict.update({int(user_id):''}) + content = '''
Your passphrase for ''' + str(user_id) + ''':
''' + str(gen_passphrase(int(user_id))) + '''
''' + if request.args.get('mode') == 'legacy': + auth_dict.update({int(user_id):0}) + content = '''Using legacy auth
''' + if request.args.get('mode') == 'custom': + auth_dict.update({int(user_id):str(request.args.get('custom'))}) + content = '''Using custom auth passphrase: ''' + request.args.get('custom') + '''
''' + print(auth_dict) @@ -36,31 +45,40 @@ def gen(): def index(): #content = Markup('The HTML String') content = ''' -- - - |
+ |
''' @@ -70,6 +88,7 @@ def index(): def auth(): hblink_req = request.json print((hblink_req)) + print(auth_dict) if hblink_req['secret'] in shared_secrets: if hblink_req['id'] in auth_dict: if auth_dict[hblink_req['id']] == 0: