@@ -9,30 +9,28 @@ typedef LocalizedMessage = String Function(ClerkSdkLocalizations localizations);
9
9
extension ClerkAuthErrorExtension on clerk.AuthError {
10
10
/// Allow localization of an [clerk.AuthError]
11
11
String localizedMessage (ClerkSdkLocalizations localizations) {
12
- switch (code) {
13
- case clerk.AuthErrorCode .noStageForStatus:
14
- return localizations.noStageForStatus (argument.toString ());
15
- case clerk.AuthErrorCode .noSessionTokenRetrieved:
16
- return localizations.noSessionTokenRetrieved;
17
- case clerk.AuthErrorCode .noAssociatedStrategy:
18
- return localizations.noAssociatedStrategy (argument.toString ());
19
- case clerk.AuthErrorCode .passwordMatchError:
20
- return localizations.passwordAndPasswordConfirmationMustMatch;
21
- case clerk.AuthErrorCode .jwtPoorlyFormatted:
22
- return localizations.jwtPoorlyFormatted (argument.toString ());
23
- case clerk.AuthErrorCode .actionNotTimely:
24
- return localizations.actionNotTimely;
25
- case clerk.AuthErrorCode .noSessionFoundForUser:
26
- return localizations.noSessionFoundForUser (argument.toString ());
27
- case clerk.AuthErrorCode .noSuchFirstFactorStrategy:
28
- return localizations.noSuchFirstFactorStrategy (argument.toString ());
29
- case clerk.AuthErrorCode .noSuchSecondFactorStrategy:
30
- return localizations.noSuchSecondFactorStrategy (argument.toString ());
31
- case clerk.AuthErrorCode .signInError:
32
- return localizations.signInError (argument.toString ());
33
- default :
34
- return toString ();
35
- }
12
+ return switch (code) {
13
+ clerk.AuthErrorCode .noStageForStatus =>
14
+ localizations.noStageForStatus (argument.toString ()),
15
+ clerk.AuthErrorCode .noSessionTokenRetrieved =>
16
+ localizations.noSessionTokenRetrieved,
17
+ clerk.AuthErrorCode .noAssociatedStrategy =>
18
+ localizations.noAssociatedStrategy (argument.toString ()),
19
+ clerk.AuthErrorCode .passwordMatchError =>
20
+ localizations.passwordAndPasswordConfirmationMustMatch,
21
+ clerk.AuthErrorCode .jwtPoorlyFormatted =>
22
+ localizations.jwtPoorlyFormatted (argument.toString ()),
23
+ clerk.AuthErrorCode .actionNotTimely => localizations.actionNotTimely,
24
+ clerk.AuthErrorCode .noSessionFoundForUser =>
25
+ localizations.noSessionFoundForUser (argument.toString ()),
26
+ clerk.AuthErrorCode .noSuchFirstFactorStrategy =>
27
+ localizations.noSuchFirstFactorStrategy (argument.toString ()),
28
+ clerk.AuthErrorCode .noSuchSecondFactorStrategy =>
29
+ localizations.noSuchSecondFactorStrategy (argument.toString ()),
30
+ clerk.AuthErrorCode .signInError =>
31
+ localizations.signInError (argument.toString ()),
32
+ _ => toString (),
33
+ };
36
34
}
37
35
}
38
36
0 commit comments