Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Conversation

@sourcery-ai
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Jan 22, 2023

Pull Request #196 refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the j0/add_mfa_bindings branch, then run:

git fetch origin sourcery/j0/add_mfa_bindings
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from J0 January 22, 2023 15:05
@sourcery-ai sourcery-ai bot force-pushed the sourcery/j0/add_mfa_bindings branch from 3000434 to 60d3f7a Compare January 22, 2023 15:09
if not jwt:
session = self.get_session()
if session:
if session := self.get_session():
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function SyncGoTrueClient.get_user refactored with the following changes:

Comment on lines -538 to -546
session = self.get_session()
if not session:
if session := self.get_session():
return self._request(
"POST",
f"factors/{params.get('factor_id')}/challenge",
jwt=session.access_token,
xform=AuthMFAChallengeResponse.parse_obj,
)
else:
raise AuthSessionMissingError()
return self._request(
"POST",
f"factors/{params.get('factor_id')}/challenge",
jwt=session.access_token,
xform=AuthMFAChallengeResponse.parse_obj,
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function SyncGoTrueClient._challenge refactored with the following changes:

Comment on lines -582 to -590
session = self.get_session()
if not session:
if session := self.get_session():
return self._request(
"DELETE",
f"factors/{params.get('factor_id')}",
jwt=session.access_token,
xform=AuthMFAUnenrollResponse.parse_obj,
)
else:
raise AuthSessionMissingError()
return self._request(
"DELETE",
f"factors/{params.get('factor_id')}",
jwt=session.access_token,
xform=AuthMFAUnenrollResponse.parse_obj,
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function SyncGoTrueClient._unenroll refactored with the following changes:

@J0 J0 merged commit cfdfb13 into j0/add_mfa_bindings Jan 22, 2023
@leynier leynier deleted the sourcery/j0/add_mfa_bindings branch January 29, 2023 12:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants