Started implementing username and password check
This commit is contained in:
parent
e7407fd40b
commit
770e3e0285
2 changed files with 21 additions and 0 deletions
|
@ -119,6 +119,14 @@ def refresh():
|
|||
return ret, 200
|
||||
|
||||
|
||||
@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
|
||||
|
||||
|
||||
@app.route('/api/protected')
|
||||
@flask_praetorian.auth_required
|
||||
def protected():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue