diff --git a/frontend/pshared/lib/api/responses/login_pending.dart b/frontend/pshared/lib/api/responses/login_pending.dart index 99e08874..cfba88a1 100644 --- a/frontend/pshared/lib/api/responses/login_pending.dart +++ b/frontend/pshared/lib/api/responses/login_pending.dart @@ -10,6 +10,7 @@ part 'login_pending.g.dart'; class PendingLoginResponse { final AccountResponse account; final TokenData pendingToken; + @JsonKey(name: 'target', readValue: _readTarget) final String target; const PendingLoginResponse({ @@ -21,4 +22,6 @@ class PendingLoginResponse { factory PendingLoginResponse.fromJson(Map json) => _$PendingLoginResponseFromJson(json); Map toJson() => _$PendingLoginResponseToJson(this); + + static String _readTarget(Map json, String key) => json[key] ?? json['destination']; }