Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hashers.py #216

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Update hashers.py #216

wants to merge 3 commits into from

Conversation

Kokoserver
Copy link
Contributor

Handling of asynchronous setter functions: You enhanced the function to handle both synchronous and asynchronous setter functions. If setter is a coroutine function (checked using asyncio.iscoroutinefunction(setter)), using asyncio.run(setter(password)) to run it. runs the passed coroutine and returns the result while automatically managing the event loop. This change allows for more flexibility in the setter functions that can be used with check_password.
Direct call for synchronous setter functions: If setter is not a coroutine function, you call it directly as setter(password). This is the same as before, but it's now part of an else clause, executed only when setter is not a coroutine function.

enhanced the check_password function to handle both synchronous and asynchronous setter functions. If setter is a coroutine function.
Use esmerald utils to check if a function is asynchronous or not
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant