Skip to content

updateUser() from GoTrue returns a UserResponse. The UserResponse doesn't contain an error parameter #1252

@JaseElder

Description

@JaseElder

Describe the bug
in updateUser(), updating the user with the same password as current will generate an error: {errorMessage: type 'Null' is not a subtype of type 'UserResponse' in type cast} because in this case it doesn't return a UserResponse

To Reproduce
Steps to reproduce the behavior:

  1. call
  final userResponse = await _supabase.auth.updateUser(
        UserAttributes(password: newPassword),
      );

where newPassword == old password.

Expected behavior
I would expect an exception to be thrown, rather than a generic null error.

Version (please complete the following information):
On Linux/macOS

❯ dart pub deps | grep -E "supabase|gotrue|postgrest|storage_client|realtime_client|functions_client"
├── brick_offline_first_with_supabase 1.3.0
│   ├── brick_supabase...
│   └── supabase...
├── brick_offline_first_with_supabase_build 1.1.0
│   ├── brick_offline_first_with_supabase...
│   ├── brick_supabase...
│   ├── brick_supabase_generators 1.2.0
│   │   ├── brick_supabase...
├── brick_supabase 1.4.1+1
│   └── supabase 2.9.2
│       ├── functions_client 2.4.4
│       ├── gotrue 2.15.0
│       ├── postgrest 2.5.0
│       ├── realtime_client 2.5.3
│       ├── storage_client 2.4.1
├── supabase_flutter 2.10.2
│   ├── supabase...

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions