some changes to auth and group api

This commit is contained in:
2019-04-15 14:14:42 +02:00
parent cbc269edf2
commit 3ecc8e0955
6 changed files with 158 additions and 6 deletions

View File

@@ -136,13 +136,14 @@ def oidc(redirect_url=None):
return response
@auth_api_bp.route('/refresh', methods=['POST'])
@auth_api_bp.route('/refresh', methods=['GET'])
@jwt_refresh_token_required
def refresh():
"""Refresh token endpoint. This will generate a new access token from
the refresh token, but will mark that access token as non-fresh,
as we do not actually verify a password in this endpoint."""
current_user = get_jwt_identity()
app.logger.info("Refreshing token for " + current_user)
new_token = create_access_token(identity=current_user, fresh=False)
ret = {'access_token': new_token}
return jsonify(ret), 200