auth0 / auth0-flutter

Auth0 SDK for Flutter
https://pub.dev/documentation/auth0_flutter/latest/
Apache License 2.0
57 stars 36 forks source link

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

Closed MilesAdamson closed 7 months ago

MilesAdamson commented 7 months ago

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

Widcket commented 7 months ago

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 1 month ago

@Widcket I have a PR up