Check if username is the same as in the current session

This commit is contained in:
cami 2021-07-22 03:11:28 +02:00
parent 770e3e0285
commit 130088756d
2 changed files with 23 additions and 9 deletions

View file

@ -122,9 +122,9 @@ def refresh():
@app.route('/api/username', methods=['GET'])
@flask_praetorian.auth_required
def get_username():
user = flask_praetorian.current_user().username
ret = {'username': user}
return user, 200
username = flask_praetorian.current_user().username
ret = {'username': username}
return ret, 200
@app.route('/api/protected')