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

auth: updateUser throws TypeError when new password is too short #891

Closed
devj3ns opened this issue Apr 17, 2024 · 0 comments · Fixed by #897
Closed

auth: updateUser throws TypeError when new password is too short #891

devj3ns opened this issue Apr 17, 2024 · 0 comments · Fixed by #897
Labels
auth This issue or pull request is related to authentication bug Something isn't working

Comments

@devj3ns
Copy link

devj3ns commented Apr 17, 2024

Describe the bug
When using the updateUser function to update the users password and providing a too short password, the function throws the following exception:

TypeError: Instance of 'JSArray<dynamic>': type 'List<dynamic>' is not a subtype of type 'List<String>'

To Reproduce
Run the following example code when being logged in with the minimum password setting in the Supabase Dashboard set to a value >3:

final supabase = Supabase.instance.client;
await supabase.auth.updateUser(auth.UserAttributes(password: "123"));

Expected behavior
I would expect the function to throw the AuthWeakPasswordException

Version:
Happens on Android and the Web. Flutter Version: 3.19.5

????????? supabase_flutter 2.5.1
??? ????????? supabase 2.1.1
??? ??? ????????? functions_client 2.0.0
??? ??? ????????? gotrue 2.6.0
??? ??? ????????? postgrest 2.1.1
??? ??? ????????? realtime_client 2.0.4
??? ??? ????????? storage_client 2.0.1

Additional context
I debugged the supbase_flutter code a bit and to me, it looks like the problem is inside the GotrueFetch _handleError function:

// Check if weak password reasons only contain strings

I assume the issue is introduced with #879

@devj3ns devj3ns added the bug Something isn't working label Apr 17, 2024
@dshukertjr dshukertjr added the auth This issue or pull request is related to authentication label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth This issue or pull request is related to authentication bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants