Add generated password to frontend
This commit is contained in:
parent
5e07b3b7dd
commit
c67da25cc9
3 changed files with 22 additions and 10 deletions
|
@ -132,12 +132,14 @@ def protected():
|
|||
"""
|
||||
return {'message': f'protected endpoint (allowed user {flask_praetorian.current_user().username})'}
|
||||
|
||||
|
||||
@app.route('/api/protected/rcv_pw', methods=['GET'])
|
||||
# @flask_praetorian.auth_required
|
||||
def get_password():
|
||||
pw = get_random_password()
|
||||
print(pw)
|
||||
return pw
|
||||
ret = {'password': pw}
|
||||
return ret, 200
|
||||
|
||||
|
||||
@app.route('/api/register', methods=['POST'])
|
||||
def register():
|
||||
|
@ -246,8 +248,6 @@ def survey():
|
|||
return ret, 400
|
||||
|
||||
|
||||
|
||||
|
||||
# Run the example
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=debug, host=host, port=port)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue