File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -28,24 +28,22 @@ class AuthApi {
2828 }
2929
3030 final data = result.getOrThrow ().data;
31+ final finalData = data['data' ] ?? data;
32+ // NOTE: Legacy API responses may not include 'data' wrapper, handle both formats
33+
3134 await cookieManager.setCookie (
3235 url: WebUri .uri (result.getOrThrow ().requestOptions.uri),
3336 name: 'cw_d_session_info' ,
3437 value: Uri .encodeComponent (jsonEncode (result.getOrThrow ().headers.map)),
3538 );
3639
37- return ProfileInfo .fromJson (data ).toSuccess ();
40+ return ProfileInfo .fromJson (finalData ).toSuccess ();
3841 }
3942
40- Future <Result <String >> resetPassword ({
41- required String email,
42- }) async {
43+ Future <Result <String >> resetPassword ({required String email}) async {
4344 final path = '${service .baseUrl .value }/auth/password' ;
4445
45- final result = await service.post <String >(
46- path,
47- data: {'email' : email},
48- );
46+ final result = await service.post <String >(path, data: {'email' : email});
4947 if (result.isError ()) {
5048 return result.exceptionOrNull ()! .toFailure ();
5149 }
You can’t perform that action at this time.
0 commit comments