Credentials toMap loses data. The user property is not populated into the map
MilesAdamson opened this issue · 2 comments
MilesAdamson commented
Checklist
- The issue can be reproduced in the auth0_flutter sample app (or N/A).
- I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
- I have looked into the API documentation and have not found a suitable solution or answer.
- I have searched the issues and have not found a suitable solution or answer.
- I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- I agree to the terms within the Auth0 Code of Conduct.
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
- get a Credentials object
- turn it into a map with
toMap
- 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
Widcket commented
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.
MilesAdamson commented
@Widcket I have a PR up