auth0/auth0-flutter

Credentials toMap loses data. The user property is not populated into the map

MilesAdamson opened this issue · 2 comments

Checklist

Description

The following makes the error type 'Null' is not a subtype of type 'Map<dynamic, dynamic>' in type cast. Because user is required in fromMap, but not provided in toMap. UserProfile does not have a toMap method

  1. get a Credentials object
  2. turn it into a map with toMap
  3. try to create a Credentials object from that map

Reproduction

final result = Credentials.fromMap(credentials.toMap());

Additional context

No response

auth0_flutter version

1.4.1

Flutter version

3.16.3

Platform

Android, iOS

Platform version(s)

all

Hi @MilesAdamson, thanks for raising this.

The UserProfile type currently does not support map conversion. We're aware of this, but do not have short-term plans to add it ATM. We'd welcome a PR adding it.

@Widcket I have a PR up