Check if username is the same as in the current session
This commit is contained in:
parent
770e3e0285
commit
130088756d
2 changed files with 23 additions and 9 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue