Skip to content

Commit

Permalink
update login nginx config
Browse files Browse the repository at this point in the history
  • Loading branch information
StarmanMartin committed May 29, 2024
1 parent 878f060 commit fed3d01
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions converter_app/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ def verify_password(username, password):
if hashed_password is not None:
if checkpw(password.encode(), hashed_password.encode()):
return username
raise PermissionError(f'User: {username} and/or password are not correct!')

return None
return auth


Expand Down Expand Up @@ -205,6 +204,7 @@ def retrieve_profile(profile_id):
if profile:
return jsonify(profile.as_dict), 200
abort(404)
return None

@app.route('/profiles/<profile_id>', methods=['PUT'])
@auth.login_required
Expand All @@ -222,6 +222,7 @@ def update_profile(profile_id):
return jsonify(profile.as_dict), 200
return jsonify(profile.errors), 400
abort(404)
return None

@app.route('/profiles/<profile_id>', methods=['DELETE'])
@auth.login_required
Expand All @@ -232,6 +233,7 @@ def delete_profile(profile_id):
profile.delete()
return '', 204
abort(404)
return None


def utils_router(app: Flask, auth: HTTPBasicAuth):
Expand Down

0 comments on commit fed3d01

Please sign in to comment.