diff --git a/flutter_reach_five/CHANGELOG.md b/flutter_reach_five/CHANGELOG.md index 4021f37..1abcf6a 100644 --- a/flutter_reach_five/CHANGELOG.md +++ b/flutter_reach_five/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.0.5 + +- **FEAT**: Add `PasswordTooWeakException` thrown when trying to set a password that is too weak or that has leaked + # 2.0.4 - **FEAT**: Add `AccountTemporarilySuspendedException` thrown when an account is temporarily suspended (for example because of a detected usage of leaked credentials) diff --git a/flutter_reach_five/lib/helpers/adapt_errors.dart b/flutter_reach_five/lib/helpers/adapt_errors.dart index 8fb8109..1e145cc 100644 --- a/flutter_reach_five/lib/helpers/adapt_errors.dart +++ b/flutter_reach_five/lib/helpers/adapt_errors.dart @@ -40,5 +40,8 @@ Never adaptErrors({required Object error, required StackTrace stackTrace}) { if (error is AccountTemporarilySuspendedExceptionInterface) { throw AccountTemporarilySuspendedException(error.message); } + if (error is PasswordTooWeakExceptionInterface) { + throw PasswordTooWeakException(); + } Error.throwWithStackTrace(error, stackTrace); } diff --git a/flutter_reach_five/lib/models/errors.dart b/flutter_reach_five/lib/models/errors.dart index 24545ef..e40f983 100644 --- a/flutter_reach_five/lib/models/errors.dart +++ b/flutter_reach_five/lib/models/errors.dart @@ -83,3 +83,8 @@ class AccountTemporarilySuspendedException extends FormatException { /// {@macro flutter_reach_five.errors.account_temporarily_suspended} const AccountTemporarilySuspendedException([super.message = '']); } + +/// {@template flutter_reach_five.errors.password_too_weak} +/// Error thrown when trying to set a password that is too weak or that has leaked +/// {@endtemplate} +class PasswordTooWeakException implements Exception {} diff --git a/flutter_reach_five/pubspec.yaml b/flutter_reach_five/pubspec.yaml index 6ce0e36..e390208 100644 --- a/flutter_reach_five/pubspec.yaml +++ b/flutter_reach_five/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_reach_five description: This package allows you to use the methods from the reachFive android and ios native sdks in Flutter -version: 2.0.4 +version: 2.0.5 homepage: https://github.com/bamlab/Flutter-ReachFive repository: https://github.com/bamlab/Flutter-ReachFive @@ -22,9 +22,9 @@ dependencies: equatable: ^2.0.5 flutter: sdk: flutter - flutter_reach_five_android: ^2.0.4 - flutter_reach_five_ios: ^2.0.4 - flutter_reach_five_platform_interface: ^2.0.4 + flutter_reach_five_android: ^2.0.5 + flutter_reach_five_ios: ^2.0.5 + flutter_reach_five_platform_interface: ^2.0.5 freezed: ^3.2.3 freezed_annotation: ^3.1.0 reach_five_identity_repo: ^2.0.0 diff --git a/flutter_reach_five/test/helpers/adapt_errors_test.dart b/flutter_reach_five/test/helpers/adapt_errors_test.dart index 974c0a8..f032ced 100644 --- a/flutter_reach_five/test/helpers/adapt_errors_test.dart +++ b/flutter_reach_five/test/helpers/adapt_errors_test.dart @@ -203,5 +203,20 @@ void main() { expect(error, isA()); }); + + test('$PasswordTooWeakException', () async { + Object? error; + + try { + adaptErrors( + error: PasswordTooWeakExceptionInterface(), + stackTrace: StackTrace.fromString('test'), + ); + } catch (e) { + error = e; + } + + expect(error, isA()); + }); }); } diff --git a/flutter_reach_five_android/CHANGELOG.md b/flutter_reach_five_android/CHANGELOG.md index 39a0de7..176e92d 100644 --- a/flutter_reach_five_android/CHANGELOG.md +++ b/flutter_reach_five_android/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.0.5 + +- **FEAT**: Handle password too weak error (`password_too_weak`) + # 2.0.4 - **FEAT**: Handle account temporarily suspended error (`error.account.temporarilySuspended`) diff --git a/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/Converters.kt b/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/Converters.kt index 7903640..10a01e7 100644 --- a/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/Converters.kt +++ b/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/Converters.kt @@ -118,6 +118,14 @@ class Converters { details = null ) } + if (reachFiveError.data?.error == "password_too_weak") { + val errorCode = errorCodesInterface.passwordTooWeakError + return FlutterError( + code= errorCode, + message= null, + details = null + ) + } return defaultFlutterError } diff --git a/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/ReachFiveApi.kt b/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/ReachFiveApi.kt index 5640b5d..30dff15 100644 --- a/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/ReachFiveApi.kt +++ b/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/ReachFiveApi.kt @@ -228,7 +228,8 @@ data class ErrorCodesInterface ( val accountBlockedAfterMultipleLoginAttempts: String, val tooManyAttempts: String, val passwordPolicyError: String, - val accountTemporarilySuspended: String + val accountTemporarilySuspended: String, + val passwordTooWeakError: String ) { companion object { @@ -245,7 +246,8 @@ data class ErrorCodesInterface ( val tooManyAttempts = pigeonVar_list[9] as String val passwordPolicyError = pigeonVar_list[10] as String val accountTemporarilySuspended = pigeonVar_list[11] as String - return ErrorCodesInterface(emailAlreadyInUseCode, invalidEmailOrPasswordCode, invalidVerificationCode, updateSamePassword, invalidGrant, userCancelledOrClosedTheWebFlow, socialAccountEmailAlreadyInUse, unauthorizedRefreshToken, accountBlockedAfterMultipleLoginAttempts, tooManyAttempts, passwordPolicyError, accountTemporarilySuspended) + val passwordTooWeakError = pigeonVar_list[12] as String + return ErrorCodesInterface(emailAlreadyInUseCode, invalidEmailOrPasswordCode, invalidVerificationCode, updateSamePassword, invalidGrant, userCancelledOrClosedTheWebFlow, socialAccountEmailAlreadyInUse, unauthorizedRefreshToken, accountBlockedAfterMultipleLoginAttempts, tooManyAttempts, passwordPolicyError, accountTemporarilySuspended, passwordTooWeakError) } } fun toList(): List { @@ -262,6 +264,7 @@ data class ErrorCodesInterface ( tooManyAttempts, passwordPolicyError, accountTemporarilySuspended, + passwordTooWeakError, ) } override fun equals(other: Any?): Boolean { @@ -272,7 +275,7 @@ data class ErrorCodesInterface ( return true } val other = other as ErrorCodesInterface - return ReachFiveApiPigeonUtils.deepEquals(this.emailAlreadyInUseCode, other.emailAlreadyInUseCode) && ReachFiveApiPigeonUtils.deepEquals(this.invalidEmailOrPasswordCode, other.invalidEmailOrPasswordCode) && ReachFiveApiPigeonUtils.deepEquals(this.invalidVerificationCode, other.invalidVerificationCode) && ReachFiveApiPigeonUtils.deepEquals(this.updateSamePassword, other.updateSamePassword) && ReachFiveApiPigeonUtils.deepEquals(this.invalidGrant, other.invalidGrant) && ReachFiveApiPigeonUtils.deepEquals(this.userCancelledOrClosedTheWebFlow, other.userCancelledOrClosedTheWebFlow) && ReachFiveApiPigeonUtils.deepEquals(this.socialAccountEmailAlreadyInUse, other.socialAccountEmailAlreadyInUse) && ReachFiveApiPigeonUtils.deepEquals(this.unauthorizedRefreshToken, other.unauthorizedRefreshToken) && ReachFiveApiPigeonUtils.deepEquals(this.accountBlockedAfterMultipleLoginAttempts, other.accountBlockedAfterMultipleLoginAttempts) && ReachFiveApiPigeonUtils.deepEquals(this.tooManyAttempts, other.tooManyAttempts) && ReachFiveApiPigeonUtils.deepEquals(this.passwordPolicyError, other.passwordPolicyError) && ReachFiveApiPigeonUtils.deepEquals(this.accountTemporarilySuspended, other.accountTemporarilySuspended) + return ReachFiveApiPigeonUtils.deepEquals(this.emailAlreadyInUseCode, other.emailAlreadyInUseCode) && ReachFiveApiPigeonUtils.deepEquals(this.invalidEmailOrPasswordCode, other.invalidEmailOrPasswordCode) && ReachFiveApiPigeonUtils.deepEquals(this.invalidVerificationCode, other.invalidVerificationCode) && ReachFiveApiPigeonUtils.deepEquals(this.updateSamePassword, other.updateSamePassword) && ReachFiveApiPigeonUtils.deepEquals(this.invalidGrant, other.invalidGrant) && ReachFiveApiPigeonUtils.deepEquals(this.userCancelledOrClosedTheWebFlow, other.userCancelledOrClosedTheWebFlow) && ReachFiveApiPigeonUtils.deepEquals(this.socialAccountEmailAlreadyInUse, other.socialAccountEmailAlreadyInUse) && ReachFiveApiPigeonUtils.deepEquals(this.unauthorizedRefreshToken, other.unauthorizedRefreshToken) && ReachFiveApiPigeonUtils.deepEquals(this.accountBlockedAfterMultipleLoginAttempts, other.accountBlockedAfterMultipleLoginAttempts) && ReachFiveApiPigeonUtils.deepEquals(this.tooManyAttempts, other.tooManyAttempts) && ReachFiveApiPigeonUtils.deepEquals(this.passwordPolicyError, other.passwordPolicyError) && ReachFiveApiPigeonUtils.deepEquals(this.accountTemporarilySuspended, other.accountTemporarilySuspended) && ReachFiveApiPigeonUtils.deepEquals(this.passwordTooWeakError, other.passwordTooWeakError) } override fun hashCode(): Int { @@ -289,6 +292,7 @@ data class ErrorCodesInterface ( result = 31 * result + ReachFiveApiPigeonUtils.deepHash(this.tooManyAttempts) result = 31 * result + ReachFiveApiPigeonUtils.deepHash(this.passwordPolicyError) result = 31 * result + ReachFiveApiPigeonUtils.deepHash(this.accountTemporarilySuspended) + result = 31 * result + ReachFiveApiPigeonUtils.deepHash(this.passwordTooWeakError) return result } } diff --git a/flutter_reach_five_android/lib/flutter_reach_five_android.dart b/flutter_reach_five_android/lib/flutter_reach_five_android.dart index dbeae5f..83d63ba 100644 --- a/flutter_reach_five_android/lib/flutter_reach_five_android.dart +++ b/flutter_reach_five_android/lib/flutter_reach_five_android.dart @@ -52,6 +52,8 @@ class FlutterReachFiveAndroid extends FlutterReachFivePlatform { throw AccountTemporarilySuspendedExceptionInterface( error.message ?? '', ); + } else if (errorCode.contains(errorCodesInterface.passwordTooWeakError)) { + throw PasswordTooWeakExceptionInterface(); } } return Error.throwWithStackTrace(error, stackTrace); diff --git a/flutter_reach_five_android/pubspec.yaml b/flutter_reach_five_android/pubspec.yaml index 5efddc2..06a99f7 100644 --- a/flutter_reach_five_android/pubspec.yaml +++ b/flutter_reach_five_android/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_reach_five_android description: Android implementation of the flutter_reach_five plugin -version: 2.0.4 +version: 2.0.5 homepage: https://github.com/bamlab/Flutter-ReachFive environment: @@ -19,7 +19,7 @@ flutter: dependencies: flutter: sdk: flutter - flutter_reach_five_platform_interface: ^2.0.4 + flutter_reach_five_platform_interface: ^2.0.5 dev_dependencies: flutter_test: diff --git a/flutter_reach_five_android/test/flutter_reach_five_android_test.dart b/flutter_reach_five_android/test/flutter_reach_five_android_test.dart index 15d8070..54c84cd 100644 --- a/flutter_reach_five_android/test/flutter_reach_five_android_test.dart +++ b/flutter_reach_five_android/test/flutter_reach_five_android_test.dart @@ -316,6 +316,26 @@ void main() { expect(error, isA()); }); + + test('$PasswordTooWeakExceptionInterface', () { + final exception = PlatformException( + code: 'Error - ${errorCodesInterface.passwordTooWeakError}', + message: 'FlutterError', + ); + + Object? error; + + try { + FlutterReachFiveAndroid().parseError( + exception, + StackTrace.fromString('test'), + ); + } catch (e) { + error = e; + } + + expect(error, isA()); + }); }); }); } diff --git a/flutter_reach_five_ios/CHANGELOG.md b/flutter_reach_five_ios/CHANGELOG.md index 7eec094..e5c6ddc 100644 --- a/flutter_reach_five_ios/CHANGELOG.md +++ b/flutter_reach_five_ios/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.0.5 + +- **FEAT**: Handle password too weak error (`password_too_weak`) + # 2.0.4 - **FEAT**: Handle account temporarily suspended error (`error.account.temporarilySuspended`) diff --git a/flutter_reach_five_ios/ios/flutter_reach_five_ios/Sources/flutter_reach_five_ios/Converters.swift b/flutter_reach_five_ios/ios/flutter_reach_five_ios/Sources/flutter_reach_five_ios/Converters.swift index 2e3fade..7db4108 100644 --- a/flutter_reach_five_ios/ios/flutter_reach_five_ios/Sources/flutter_reach_five_ios/Converters.swift +++ b/flutter_reach_five_ios/ios/flutter_reach_five_ios/Sources/flutter_reach_five_ios/Converters.swift @@ -58,6 +58,13 @@ public class Converters { details: nil ) } + if (apiError.error == "password_too_weak") { + return PigeonError( + code: errorCodesInterface.passwordTooWeakError, + message: nil, + details: nil + ) + } return defaultFlutterError case .AuthFailure(reason: _, apiError: let apiError): if (apiError?.errorMessageKey == "error.invalidEmailOrPassword") { diff --git a/flutter_reach_five_ios/ios/flutter_reach_five_ios/Sources/flutter_reach_five_ios/reach_five_api.swift b/flutter_reach_five_ios/ios/flutter_reach_five_ios/Sources/flutter_reach_five_ios/reach_five_api.swift index 8dfcf50..649a2bb 100644 --- a/flutter_reach_five_ios/ios/flutter_reach_five_ios/Sources/flutter_reach_five_ios/reach_five_api.swift +++ b/flutter_reach_five_ios/ios/flutter_reach_five_ios/Sources/flutter_reach_five_ios/reach_five_api.swift @@ -199,6 +199,7 @@ struct ErrorCodesInterface: Hashable { var tooManyAttempts: String var passwordPolicyError: String var accountTemporarilySuspended: String + var passwordTooWeakError: String // swift-format-ignore: AlwaysUseLowerCamelCase @@ -215,6 +216,7 @@ struct ErrorCodesInterface: Hashable { let tooManyAttempts = pigeonVar_list[9] as! String let passwordPolicyError = pigeonVar_list[10] as! String let accountTemporarilySuspended = pigeonVar_list[11] as! String + let passwordTooWeakError = pigeonVar_list[12] as! String return ErrorCodesInterface( emailAlreadyInUseCode: emailAlreadyInUseCode, @@ -228,7 +230,8 @@ struct ErrorCodesInterface: Hashable { accountBlockedAfterMultipleLoginAttempts: accountBlockedAfterMultipleLoginAttempts, tooManyAttempts: tooManyAttempts, passwordPolicyError: passwordPolicyError, - accountTemporarilySuspended: accountTemporarilySuspended + accountTemporarilySuspended: accountTemporarilySuspended, + passwordTooWeakError: passwordTooWeakError ) } func toList() -> [Any?] { @@ -245,13 +248,14 @@ struct ErrorCodesInterface: Hashable { tooManyAttempts, passwordPolicyError, accountTemporarilySuspended, + passwordTooWeakError, ] } static func == (lhs: ErrorCodesInterface, rhs: ErrorCodesInterface) -> Bool { if Swift.type(of: lhs) != Swift.type(of: rhs) { return false } - return deepEqualsreach_five_api(lhs.emailAlreadyInUseCode, rhs.emailAlreadyInUseCode) && deepEqualsreach_five_api(lhs.invalidEmailOrPasswordCode, rhs.invalidEmailOrPasswordCode) && deepEqualsreach_five_api(lhs.invalidVerificationCode, rhs.invalidVerificationCode) && deepEqualsreach_five_api(lhs.updateSamePassword, rhs.updateSamePassword) && deepEqualsreach_five_api(lhs.invalidGrant, rhs.invalidGrant) && deepEqualsreach_five_api(lhs.userCancelledOrClosedTheWebFlow, rhs.userCancelledOrClosedTheWebFlow) && deepEqualsreach_five_api(lhs.socialAccountEmailAlreadyInUse, rhs.socialAccountEmailAlreadyInUse) && deepEqualsreach_five_api(lhs.unauthorizedRefreshToken, rhs.unauthorizedRefreshToken) && deepEqualsreach_five_api(lhs.accountBlockedAfterMultipleLoginAttempts, rhs.accountBlockedAfterMultipleLoginAttempts) && deepEqualsreach_five_api(lhs.tooManyAttempts, rhs.tooManyAttempts) && deepEqualsreach_five_api(lhs.passwordPolicyError, rhs.passwordPolicyError) && deepEqualsreach_five_api(lhs.accountTemporarilySuspended, rhs.accountTemporarilySuspended) + return deepEqualsreach_five_api(lhs.emailAlreadyInUseCode, rhs.emailAlreadyInUseCode) && deepEqualsreach_five_api(lhs.invalidEmailOrPasswordCode, rhs.invalidEmailOrPasswordCode) && deepEqualsreach_five_api(lhs.invalidVerificationCode, rhs.invalidVerificationCode) && deepEqualsreach_five_api(lhs.updateSamePassword, rhs.updateSamePassword) && deepEqualsreach_five_api(lhs.invalidGrant, rhs.invalidGrant) && deepEqualsreach_five_api(lhs.userCancelledOrClosedTheWebFlow, rhs.userCancelledOrClosedTheWebFlow) && deepEqualsreach_five_api(lhs.socialAccountEmailAlreadyInUse, rhs.socialAccountEmailAlreadyInUse) && deepEqualsreach_five_api(lhs.unauthorizedRefreshToken, rhs.unauthorizedRefreshToken) && deepEqualsreach_five_api(lhs.accountBlockedAfterMultipleLoginAttempts, rhs.accountBlockedAfterMultipleLoginAttempts) && deepEqualsreach_five_api(lhs.tooManyAttempts, rhs.tooManyAttempts) && deepEqualsreach_five_api(lhs.passwordPolicyError, rhs.passwordPolicyError) && deepEqualsreach_five_api(lhs.accountTemporarilySuspended, rhs.accountTemporarilySuspended) && deepEqualsreach_five_api(lhs.passwordTooWeakError, rhs.passwordTooWeakError) } func hash(into hasher: inout Hasher) { @@ -268,6 +272,7 @@ struct ErrorCodesInterface: Hashable { deepHashreach_five_api(value: tooManyAttempts, hasher: &hasher) deepHashreach_five_api(value: passwordPolicyError, hasher: &hasher) deepHashreach_five_api(value: accountTemporarilySuspended, hasher: &hasher) + deepHashreach_five_api(value: passwordTooWeakError, hasher: &hasher) } } diff --git a/flutter_reach_five_ios/lib/flutter_reach_five_ios.dart b/flutter_reach_five_ios/lib/flutter_reach_five_ios.dart index 9cfe925..3d905d2 100644 --- a/flutter_reach_five_ios/lib/flutter_reach_five_ios.dart +++ b/flutter_reach_five_ios/lib/flutter_reach_five_ios.dart @@ -41,6 +41,8 @@ class FlutterReachFiveIOS extends FlutterReachFivePlatform { throw AccountTemporarilySuspendedExceptionInterface( error.message ?? "", ); + } else if (error.code == errorCodesInterface.passwordTooWeakError) { + throw PasswordTooWeakExceptionInterface(); } } return Error.throwWithStackTrace(error, stackTrace); diff --git a/flutter_reach_five_ios/pubspec.yaml b/flutter_reach_five_ios/pubspec.yaml index c89a168..0bdb239 100644 --- a/flutter_reach_five_ios/pubspec.yaml +++ b/flutter_reach_five_ios/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_reach_five_ios description: iOS implementation of the flutter_reach_five plugin -version: 2.0.4 +version: 2.0.5 homepage: https://github.com/bamlab/Flutter-ReachFive environment: @@ -18,7 +18,7 @@ flutter: dependencies: flutter: sdk: flutter - flutter_reach_five_platform_interface: ^2.0.4 + flutter_reach_five_platform_interface: ^2.0.5 dev_dependencies: flutter_test: diff --git a/flutter_reach_five_ios/test/flutter_reach_five_ios_test.dart b/flutter_reach_five_ios/test/flutter_reach_five_ios_test.dart index cb0ba23..3dd0605 100644 --- a/flutter_reach_five_ios/test/flutter_reach_five_ios_test.dart +++ b/flutter_reach_five_ios/test/flutter_reach_five_ios_test.dart @@ -302,6 +302,25 @@ void main() { expect(error, isA()); }); + + test('$PasswordTooWeakExceptionInterface', () { + final exception = PlatformException( + code: errorCodesInterface.passwordTooWeakError, + ); + + Object? error; + + try { + FlutterReachFiveIOS().parseError( + exception, + StackTrace.fromString('test'), + ); + } catch (e) { + error = e; + } + + expect(error, isA()); + }); }); }); } diff --git a/flutter_reach_five_platform_interface/CHANGELOG.md b/flutter_reach_five_platform_interface/CHANGELOG.md index d80aaf4..4409fcb 100644 --- a/flutter_reach_five_platform_interface/CHANGELOG.md +++ b/flutter_reach_five_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.0.5 + +- **FEAT**: Add `passwordTooWeakError` error code to `ErrorCodesInterface` + # 2.0.4 - **FEAT**: Add `accountTemporarilySuspended` error code to `ErrorCodesInterface` diff --git a/flutter_reach_five_platform_interface/lib/src/errors.dart b/flutter_reach_five_platform_interface/lib/src/errors.dart index ed1029c..3d8cf23 100644 --- a/flutter_reach_five_platform_interface/lib/src/errors.dart +++ b/flutter_reach_five_platform_interface/lib/src/errors.dart @@ -16,6 +16,7 @@ final errorCodesInterface = ErrorCodesInterface( tooManyAttempts: 'rate_limiter_too_many_attempts', passwordPolicyError: 'password_policy', accountTemporarilySuspended: 'account_temporarily_suspended', + passwordTooWeakError: 'password_too_weak', ); /// {@macro flutter_reach_five.errors.email_already_in_use} @@ -77,3 +78,6 @@ class AccountTemporarilySuspendedExceptionInterface extends FormatException { const AccountTemporarilySuspendedExceptionInterface([super.message = '']); // coverage:ignore-end } + +/// {@macro flutter_reach_five.errors.password_too_weak} +class PasswordTooWeakExceptionInterface implements Exception {} diff --git a/flutter_reach_five_platform_interface/lib/src/reach_five.g.dart b/flutter_reach_five_platform_interface/lib/src/reach_five.g.dart index 46ad6e5..0784ac3 100644 --- a/flutter_reach_five_platform_interface/lib/src/reach_five.g.dart +++ b/flutter_reach_five_platform_interface/lib/src/reach_five.g.dart @@ -115,6 +115,7 @@ class ErrorCodesInterface { required this.tooManyAttempts, required this.passwordPolicyError, required this.accountTemporarilySuspended, + required this.passwordTooWeakError, }); String emailAlreadyInUseCode; @@ -141,6 +142,8 @@ class ErrorCodesInterface { String accountTemporarilySuspended; + String passwordTooWeakError; + List _toList() { return [ emailAlreadyInUseCode, @@ -155,6 +158,7 @@ class ErrorCodesInterface { tooManyAttempts, passwordPolicyError, accountTemporarilySuspended, + passwordTooWeakError, ]; } @@ -177,6 +181,7 @@ class ErrorCodesInterface { tooManyAttempts: result[9]! as String, passwordPolicyError: result[10]! as String, accountTemporarilySuspended: result[11]! as String, + passwordTooWeakError: result[12]! as String, ); } @@ -215,7 +220,8 @@ class ErrorCodesInterface { _deepEquals( accountTemporarilySuspended, other.accountTemporarilySuspended, - ); + ) && + _deepEquals(passwordTooWeakError, other.passwordTooWeakError); } @override diff --git a/flutter_reach_five_platform_interface/pigeons/reach_five.dart b/flutter_reach_five_platform_interface/pigeons/reach_five.dart index 5567bad..5da39cc 100644 --- a/flutter_reach_five_platform_interface/pigeons/reach_five.dart +++ b/flutter_reach_five_platform_interface/pigeons/reach_five.dart @@ -26,6 +26,7 @@ class ErrorCodesInterface { required this.tooManyAttempts, required this.passwordPolicyError, required this.accountTemporarilySuspended, + required this.passwordTooWeakError, }); final String emailAlreadyInUseCode; @@ -40,6 +41,7 @@ class ErrorCodesInterface { final String tooManyAttempts; final String passwordPolicyError; final String accountTemporarilySuspended; + final String passwordTooWeakError; } class SdkConfigInterface { diff --git a/flutter_reach_five_platform_interface/pubspec.yaml b/flutter_reach_five_platform_interface/pubspec.yaml index c9cf4f1..42f6a3b 100644 --- a/flutter_reach_five_platform_interface/pubspec.yaml +++ b/flutter_reach_five_platform_interface/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_reach_five_platform_interface description: A common platform interface for the flutter_reach_five plugin. -version: 2.0.4 +version: 2.0.5 homepage: https://github.com/bamlab/Flutter-ReachFive environment: