changes to auth and user API

This commit is contained in:
Tobias Kurze
2019-04-05 16:21:24 +02:00
parent 8b7b2f489c
commit f0783d97c8
2 changed files with 13 additions and 1 deletions

View File

@@ -136,7 +136,7 @@ def oidc(redirect_url=None):
return response return response
@app.route('/refresh', methods=['POST']) @auth_api_bp.route('/refresh', methods=['POST'])
@jwt_refresh_token_required @jwt_refresh_token_required
def refresh(): def refresh():
"""Refresh token endpoint. This will generate a new access token from """Refresh token endpoint. This will generate a new access token from

View File

@@ -22,6 +22,18 @@ user = api_user.model('User', {
}) })
@api_user.route('/profile', methods=['GET'])
class Profile(Resource):
@jwt_auth.login_required
@api_user.marshal_list_with(user)
def get(self):
"""Get infos about logged in user."""
current_user_id = get_jwt_identity()
app.logger.info(current_user_id)
return User.get_by_identifier(current_user_id)
@api_user.route('/') @api_user.route('/')
class UserList(Resource): class UserList(Resource):
""" """