changes to auth and user API
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user