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

[#66] Allow admin_create_user to let Cognito create a temporary password #169

Merged
merged 1 commit into from
Nov 13, 2022

Conversation

nk9
Copy link

@nk9 nk9 commented Nov 12, 2022

This addresses #66 by only adding TemporaryPassword conditionally to additional_kwargs. I've verified that Cognito is now successfully creating the user, and also generating a compliant password when admin_create_user is called with no temporary_password parameter, and also when temporary_password is None.

Two details:

  1. If the user happened to pass both TemporaryPassword in the additional_kwargs dictionary and also the temporary_password parameter, then this value would be overridden. However, I'm not sure what a user would expect to happen in that case. It seems reasonable to coalesce the values, and we have to choose one of them anyway.
  2. The user can also pass an empty string, since that's falsy in Python. Indeed, I've left the default argument value alone for this reason.

@pvizeli pvizeli merged commit f1d591b into NabuCasa:master Nov 13, 2022
@nk9
Copy link
Author

nk9 commented Nov 17, 2022

Released in 2022.11.0

@nk9 nk9 deleted the temp-password branch November 17, 2022 18:36
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.

2 participants