@umituz/react-native-auth 2.5.2 → 2.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-auth",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.3",
|
|
4
4
|
"description": "Authentication service for React Native apps - Secure, type-safe, and production-ready. Provider-agnostic design with dependency injection, configurable validation, and comprehensive error handling.",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -8,7 +8,12 @@ import { AuthError } from "../../domain/errors/AuthError";
|
|
|
8
8
|
/**
|
|
9
9
|
* Map AuthError code to localization key
|
|
10
10
|
*/
|
|
11
|
-
export function getAuthErrorLocalizationKey(error:
|
|
11
|
+
export function getAuthErrorLocalizationKey(error: unknown): string {
|
|
12
|
+
// Handle non-Error types
|
|
13
|
+
if (!(error instanceof Error)) {
|
|
14
|
+
return "auth.errors.unknownError";
|
|
15
|
+
}
|
|
16
|
+
|
|
12
17
|
const code = error instanceof AuthError ? error.code : undefined;
|
|
13
18
|
|
|
14
19
|
// Map error codes to localization keys
|