@@ -80,34 +80,24 @@ class GigyaFlutterPluginWeb extends GigyaFlutterPluginPlatform {
8080 String loginId, {
8181 Map <String , dynamic > parameters = const < String , dynamic > {},
8282 }) async {
83- final String ? passwordResetToken = parameters['passwordResetToken' ] as String ? ;
84- final String ? newPassword = parameters['newPassword' ] as String ? ;
85-
86- // Either login id or password reset token is required.
87- if (loginId.isNotEmpty && passwordResetToken != null ) {
88- throw ArgumentError ('Either loginId or passwordResetToken should be specified.' );
89- }
90-
91- // If the password reset token is present, the new password should also be present.
92- if (passwordResetToken != null && newPassword == null ) {
93- throw ArgumentError .notNull ('newPassword' );
94- }
95-
96- final ResetPasswordResponse response = gigyaWebSdk.accounts.resetPassword (
83+ final JSAny ? response = GigyaWebSdk .instance.accounts.resetPassword.callAsFunction (
84+ null ,
9785 ResetPasswordParameters (
9886 email: parameters['email' ] as String ? ,
99- ignoreInterruptions: parameters['ignoreInterruptions' ] as bool ? ?? false ,
87+ ignoreInterruptions: parameters['ignoreInterruptions' ] as bool ? ,
10088 lang: parameters['lang' ] as String ? ,
10189 // Treat an empty login id as null.
10290 loginID: loginId.isEmpty ? null : loginId,
103- newPassword: newPassword,
104- passwordResetToken: passwordResetToken,
91+ newPassword: parameters[ ' newPassword' ] as String ? ,
92+ passwordResetToken: parameters[ ' passwordResetToken' ] as String ? ,
10593 secretAnswer: parameters['secretAnswer' ] as String ? ,
10694 securityFields: parameters['securityFields' ] as String ? ,
95+ sendEmail: parameters['sendEmail' ] as bool ? ,
10796 ),
10897 );
10998
110- return StaticInteropUtils .responseToMap (response);
99+ // TODO: `callAsFunction` does not yet support generics.
100+ return (response as ResetPasswordResponse ).toMap ();
111101 }
112102
113103 @override
0 commit comments