Skip to content

Commit

Permalink
Update flask_authgen_jwt.py
Browse files Browse the repository at this point in the history
Added a better way to update username and password keys in dictionary
  • Loading branch information
dmtzs committed Feb 28, 2023
1 parent 5c069b6 commit 764cf5e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = Flask-authgen-jwt
version = 4.1.1
version = 4.1.2
author = Diego Martinez
license = MIT
author_email = [email protected]
Expand Down
6 changes: 2 additions & 4 deletions src/flask_authgen_jwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,8 @@ def __create_jwt_payload(self, bauth_credentials: dict[str, str]) -> dict[str, U
else:
bauth_credentials = request.get_json()
if self.personal_credentials is not None:
bauth_credentials[self.personal_credentials[0]] = bauth_credentials["username"]
bauth_credentials[self.personal_credentials[1]] = bauth_credentials["password"]
del bauth_credentials["username"]
del bauth_credentials["password"]
bauth_credentials[self.personal_credentials[0]] = bauth_credentials.pop("username")
bauth_credentials[self.personal_credentials[1]] = bauth_credentials.pop("password")
payload = bauth_credentials
payload.update(self.jwt_fields_attr)

Expand Down

0 comments on commit 764cf5e

Please sign in to comment.