react-native-nitro-auth 0.1.6 → 0.4.0
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/README.md +350 -38
- package/android/build.gradle +1 -1
- package/android/src/main/cpp/PlatformAuth+Android.cpp +27 -9
- package/android/src/main/java/com/auth/AuthAdapter.kt +18 -18
- package/android/src/main/java/com/auth/GoogleSignInActivity.kt +18 -3
- package/app.plugin.js +3 -3
- package/cpp/HybridAuth.cpp +20 -0
- package/cpp/HybridAuth.hpp +1 -0
- package/ios/AuthAdapter.swift +48 -47
- package/ios/PlatformAuth+iOS.mm +37 -24
- package/lib/commonjs/Auth.web.js +27 -21
- package/lib/commonjs/Auth.web.js.map +1 -1
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/service.js +130 -1
- package/lib/commonjs/service.js.map +1 -1
- package/lib/commonjs/service.web.js +40 -6
- package/lib/commonjs/service.web.js.map +1 -1
- package/lib/commonjs/ui/social-button.js +35 -7
- package/lib/commonjs/ui/social-button.js.map +1 -1
- package/lib/commonjs/ui/social-button.web.js +35 -7
- package/lib/commonjs/ui/social-button.web.js.map +1 -1
- package/lib/commonjs/use-auth.js +29 -2
- package/lib/commonjs/use-auth.js.map +1 -1
- package/lib/module/Auth.web.js +27 -21
- package/lib/module/Auth.web.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/package.json +1 -0
- package/lib/module/service.js +130 -1
- package/lib/module/service.js.map +1 -1
- package/lib/module/service.web.js +40 -1
- package/lib/module/service.web.js.map +1 -1
- package/lib/module/ui/social-button.js +36 -8
- package/lib/module/ui/social-button.js.map +1 -1
- package/lib/module/ui/social-button.web.js +36 -8
- package/lib/module/ui/social-button.web.js.map +1 -1
- package/lib/module/use-auth.js +29 -2
- package/lib/module/use-auth.js.map +1 -1
- package/lib/typescript/{Auth.nitro.d.ts → commonjs/Auth.nitro.d.ts} +7 -0
- package/lib/typescript/commonjs/Auth.nitro.d.ts.map +1 -0
- package/lib/typescript/{Auth.web.d.ts → commonjs/Auth.web.d.ts} +2 -1
- package/lib/typescript/commonjs/Auth.web.d.ts.map +1 -0
- package/lib/typescript/{AuthStorage.nitro.d.ts → commonjs/AuthStorage.nitro.d.ts} +7 -0
- package/lib/typescript/commonjs/AuthStorage.nitro.d.ts.map +1 -0
- package/lib/typescript/{index.d.ts → commonjs/index.d.ts} +1 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/service.d.ts +10 -0
- package/lib/typescript/commonjs/service.d.ts.map +1 -0
- package/lib/typescript/commonjs/service.web.d.ts +30 -0
- package/lib/typescript/commonjs/service.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/social-button.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/social-button.web.d.ts.map +1 -0
- package/lib/typescript/{use-auth.d.ts → commonjs/use-auth.d.ts} +1 -0
- package/lib/typescript/commonjs/use-auth.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/logger.d.ts.map +1 -0
- package/lib/typescript/module/Auth.nitro.d.ts +51 -0
- package/lib/typescript/module/Auth.nitro.d.ts.map +1 -0
- package/lib/typescript/module/Auth.web.d.ts +41 -0
- package/lib/typescript/module/Auth.web.d.ts.map +1 -0
- package/lib/typescript/module/AuthStorage.nitro.d.ts +26 -0
- package/lib/typescript/module/AuthStorage.nitro.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +6 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/index.web.d.ts +6 -0
- package/lib/typescript/module/index.web.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/service.d.ts +10 -0
- package/lib/typescript/module/service.d.ts.map +1 -0
- package/lib/typescript/module/service.web.d.ts +30 -0
- package/lib/typescript/module/service.web.d.ts.map +1 -0
- package/lib/typescript/module/ui/social-button.d.ts +17 -0
- package/lib/typescript/module/ui/social-button.d.ts.map +1 -0
- package/lib/typescript/module/ui/social-button.web.d.ts +17 -0
- package/lib/typescript/module/ui/social-button.web.d.ts.map +1 -0
- package/lib/typescript/module/use-auth.d.ts +16 -0
- package/lib/typescript/module/use-auth.d.ts.map +1 -0
- package/lib/typescript/module/utils/logger.d.ts +8 -0
- package/lib/typescript/module/utils/logger.d.ts.map +1 -0
- package/nitrogen/generated/android/NitroAuth+autolinking.cmake +1 -1
- package/nitrogen/generated/android/NitroAuth+autolinking.gradle +1 -1
- package/nitrogen/generated/android/NitroAuthOnLoad.cpp +1 -1
- package/nitrogen/generated/android/NitroAuthOnLoad.hpp +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/com/auth/NitroAuthOnLoad.kt +1 -1
- package/nitrogen/generated/ios/NitroAuth+autolinking.rb +2 -2
- package/nitrogen/generated/ios/NitroAuth-Swift-Cxx-Bridge.cpp +1 -1
- package/nitrogen/generated/ios/NitroAuth-Swift-Cxx-Bridge.hpp +1 -1
- package/nitrogen/generated/ios/NitroAuth-Swift-Cxx-Umbrella.hpp +1 -1
- package/nitrogen/generated/ios/NitroAuthAutolinking.mm +1 -1
- package/nitrogen/generated/ios/NitroAuthAutolinking.swift +5 -1
- package/nitrogen/generated/shared/c++/AuthProvider.hpp +1 -1
- package/nitrogen/generated/shared/c++/AuthTokens.hpp +19 -11
- package/nitrogen/generated/shared/c++/AuthUser.hpp +42 -30
- package/nitrogen/generated/shared/c++/HybridAuthSpec.cpp +2 -1
- package/nitrogen/generated/shared/c++/HybridAuthSpec.hpp +2 -1
- package/nitrogen/generated/shared/c++/HybridAuthStorageAdapterSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridAuthStorageAdapterSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/LoginOptions.hpp +28 -12
- package/package.json +7 -5
- package/react-native-nitro-auth.podspec +1 -1
- package/src/Auth.nitro.ts +8 -1
- package/src/Auth.web.ts +50 -30
- package/src/AuthStorage.nitro.ts +11 -2
- package/src/index.ts +1 -1
- package/src/service.ts +167 -2
- package/src/service.web.ts +50 -1
- package/src/ui/social-button.tsx +25 -3
- package/src/ui/social-button.web.tsx +25 -3
- package/src/use-auth.ts +27 -2
- package/lib/typescript/Auth.nitro.d.ts.map +0 -1
- package/lib/typescript/Auth.web.d.ts.map +0 -1
- package/lib/typescript/AuthStorage.nitro.d.ts.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/index.web.d.ts.map +0 -1
- package/lib/typescript/service.d.ts +0 -3
- package/lib/typescript/service.d.ts.map +0 -1
- package/lib/typescript/service.web.d.ts +0 -2
- package/lib/typescript/service.web.d.ts.map +0 -1
- package/lib/typescript/ui/social-button.d.ts.map +0 -1
- package/lib/typescript/ui/social-button.web.d.ts.map +0 -1
- package/lib/typescript/use-auth.d.ts.map +0 -1
- package/lib/typescript/utils/logger.d.ts.map +0 -1
- /package/lib/typescript/{index.web.d.ts → commonjs/index.web.d.ts} +0 -0
- /package/lib/typescript/{ui → commonjs/ui}/social-button.d.ts +0 -0
- /package/lib/typescript/{ui → commonjs/ui}/social-button.web.d.ts +0 -0
- /package/lib/typescript/{utils → commonjs/utils}/logger.d.ts +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { HybridObject } from "react-native-nitro-modules";
|
|
2
|
+
import type { AuthStorageAdapter } from "./AuthStorage.nitro";
|
|
3
|
+
export type AuthProvider = "google" | "apple";
|
|
4
|
+
export type AuthErrorCode = "cancelled" | "network_error" | "configuration_error" | "unsupported_provider" | "unknown";
|
|
5
|
+
export interface LoginOptions {
|
|
6
|
+
scopes?: string[];
|
|
7
|
+
loginHint?: string;
|
|
8
|
+
useOneTap?: boolean;
|
|
9
|
+
/** (iOS only) Use native sign-in sheet */
|
|
10
|
+
useSheet?: boolean;
|
|
11
|
+
/** Force account picker to show, ignoring any cached session or loginHint */
|
|
12
|
+
forceAccountPicker?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface AuthTokens {
|
|
15
|
+
accessToken?: string;
|
|
16
|
+
idToken?: string;
|
|
17
|
+
expirationTime?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface AuthUser {
|
|
20
|
+
provider: AuthProvider;
|
|
21
|
+
email?: string;
|
|
22
|
+
name?: string;
|
|
23
|
+
photo?: string;
|
|
24
|
+
idToken?: string;
|
|
25
|
+
accessToken?: string;
|
|
26
|
+
serverAuthCode?: string;
|
|
27
|
+
scopes?: string[];
|
|
28
|
+
expirationTime?: number;
|
|
29
|
+
/** Raw native error message */
|
|
30
|
+
underlyingError?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface Auth extends HybridObject<{
|
|
33
|
+
ios: "c++";
|
|
34
|
+
android: "c++";
|
|
35
|
+
}> {
|
|
36
|
+
readonly currentUser: AuthUser | undefined;
|
|
37
|
+
readonly grantedScopes: string[];
|
|
38
|
+
readonly hasPlayServices: boolean;
|
|
39
|
+
login(provider: AuthProvider, options?: LoginOptions): Promise<void>;
|
|
40
|
+
requestScopes(scopes: string[]): Promise<void>;
|
|
41
|
+
revokeScopes(scopes: string[]): Promise<void>;
|
|
42
|
+
getAccessToken(): Promise<string | undefined>;
|
|
43
|
+
refreshToken(): Promise<AuthTokens>;
|
|
44
|
+
logout(): void;
|
|
45
|
+
silentRestore(): Promise<void>;
|
|
46
|
+
onAuthStateChanged(callback: (user: AuthUser | undefined) => void): () => void;
|
|
47
|
+
onTokensRefreshed(callback: (tokens: AuthTokens) => void): () => void;
|
|
48
|
+
setLoggingEnabled(enabled: boolean): void;
|
|
49
|
+
setStorageAdapter(adapter: AuthStorageAdapter | undefined): void;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=Auth.nitro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Auth.nitro.d.ts","sourceRoot":"","sources":["../../../src/Auth.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE9C,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,eAAe,GACf,qBAAqB,GACrB,sBAAsB,GACtB,SAAS,CAAC;AAEd,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6EAA6E;IAC7E,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,UAAU;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+BAA+B;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,IAAK,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,KAAK,CAAA;CAAE,CAAC;IACxE,QAAQ,CAAC,WAAW,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAElC,KAAK,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,cAAc,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC9C,YAAY,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;IAEpC,MAAM,IAAI,IAAI,CAAC;IACf,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/B,kBAAkB,CAChB,QAAQ,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,GAC7C,MAAM,IAAI,CAAC;IACd,iBAAiB,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACtE,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1C,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,SAAS,GAAG,IAAI,CAAC;CAClE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Auth, AuthUser, AuthProvider, LoginOptions, AuthTokens } from "./Auth.nitro";
|
|
2
|
+
import type { AuthStorageAdapter } from "./AuthStorage.nitro";
|
|
3
|
+
declare class AuthWeb implements Auth {
|
|
4
|
+
private _currentUser;
|
|
5
|
+
private _grantedScopes;
|
|
6
|
+
private _listeners;
|
|
7
|
+
private _tokenListeners;
|
|
8
|
+
private _storageAdapter;
|
|
9
|
+
constructor();
|
|
10
|
+
private loadFromCache;
|
|
11
|
+
private removeFromCache;
|
|
12
|
+
get currentUser(): AuthUser | undefined;
|
|
13
|
+
get grantedScopes(): string[];
|
|
14
|
+
get hasPlayServices(): boolean;
|
|
15
|
+
onAuthStateChanged(callback: (user: AuthUser | undefined) => void): () => void;
|
|
16
|
+
onTokensRefreshed(callback: (tokens: AuthTokens) => void): () => void;
|
|
17
|
+
private notify;
|
|
18
|
+
login(provider: AuthProvider, options?: LoginOptions): Promise<void>;
|
|
19
|
+
requestScopes(scopes: string[]): Promise<void>;
|
|
20
|
+
revokeScopes(scopes: string[]): Promise<void>;
|
|
21
|
+
getAccessToken(): Promise<string | undefined>;
|
|
22
|
+
refreshToken(): Promise<{
|
|
23
|
+
accessToken?: string;
|
|
24
|
+
idToken?: string;
|
|
25
|
+
}>;
|
|
26
|
+
private mapError;
|
|
27
|
+
private loginGoogle;
|
|
28
|
+
private decodeGoogleJwt;
|
|
29
|
+
private loginApple;
|
|
30
|
+
silentRestore(): Promise<void>;
|
|
31
|
+
logout(): void;
|
|
32
|
+
private updateUser;
|
|
33
|
+
setLoggingEnabled(enabled: boolean): void;
|
|
34
|
+
setStorageAdapter(adapter: AuthStorageAdapter | undefined): void;
|
|
35
|
+
name: string;
|
|
36
|
+
dispose(): void;
|
|
37
|
+
equals(other: unknown): boolean;
|
|
38
|
+
}
|
|
39
|
+
export declare const AuthModule: AuthWeb;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=Auth.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Auth.web.d.ts","sourceRoot":"","sources":["../../../src/Auth.web.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,UAAU,EACX,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AA6B9D,cAAM,OAAQ,YAAW,IAAI;IAC3B,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,cAAc,CAAgB;IACtC,OAAO,CAAC,UAAU,CAAgD;IAClE,OAAO,CAAC,eAAe,CAAwC;IAC/D,OAAO,CAAC,eAAe,CAAiC;;IAMxD,OAAO,CAAC,aAAa;IA0BrB,OAAO,CAAC,eAAe;IAQvB,IAAI,WAAW,IAAI,QAAQ,GAAG,SAAS,CAEtC;IAED,IAAI,aAAa,IAAI,MAAM,EAAE,CAE5B;IAED,IAAI,eAAe,IAAI,OAAO,CAE7B;IAED,kBAAkB,CAChB,QAAQ,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,GAC7C,MAAM,IAAI;IAQb,iBAAiB,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,GAAG,MAAM,IAAI;IAOrE,OAAO,CAAC,MAAM;IAIR,KAAK,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBpE,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB9C,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAmB7C,cAAc,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAW7C,YAAY,IAAI,OAAO,CAAC;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAmBzE,OAAO,CAAC,QAAQ;YAgBF,WAAW;IA8FzB,OAAO,CAAC,eAAe;YAcT,UAAU;IA+ClB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAcpC,MAAM,IAAI,IAAI;IAQd,OAAO,CAAC,UAAU;IAUlB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAIzC,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,SAAS,GAAG,IAAI;IAQhE,IAAI,SAAU;IACd,OAAO;IACP,MAAM,CAAC,KAAK,EAAE,OAAO;CAGtB;AAED,eAAO,MAAM,UAAU,SAAgB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { HybridObject } from "react-native-nitro-modules";
|
|
2
|
+
/**
|
|
3
|
+
* Custom storage adapter for persisting auth state.
|
|
4
|
+
*
|
|
5
|
+
* On native platforms, this must be a native HybridObject (Swift/Kotlin).
|
|
6
|
+
* For JS-based storage (AsyncStorage, MMKV), use the JS wrapper approach
|
|
7
|
+
* documented in the README.
|
|
8
|
+
*/
|
|
9
|
+
export interface AuthStorageAdapter extends HybridObject<{
|
|
10
|
+
ios: "c++";
|
|
11
|
+
android: "c++";
|
|
12
|
+
}> {
|
|
13
|
+
/**
|
|
14
|
+
* Called to save a value to the custom storage.
|
|
15
|
+
*/
|
|
16
|
+
save(key: string, value: string): void;
|
|
17
|
+
/**
|
|
18
|
+
* Called to load a value from the custom storage.
|
|
19
|
+
*/
|
|
20
|
+
load(key: string): string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Called to remove a value from the custom storage.
|
|
23
|
+
*/
|
|
24
|
+
remove(key: string): void;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=AuthStorage.nitro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthStorage.nitro.d.ts","sourceRoot":"","sources":["../../../src/AuthStorage.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D;;;;;;GAMG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY,CAAC;IACvD,GAAG,EAAE,KAAK,CAAC;IACX,OAAO,EAAE,KAAK,CAAC;CAChB,CAAC;IACA;;OAEG;IACH,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC;;OAEG;IACH,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACtC;;OAEG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../src/index.web.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Auth } from "./Auth.nitro";
|
|
2
|
+
export interface JSStorageAdapter {
|
|
3
|
+
save(key: string, value: string): void | Promise<void>;
|
|
4
|
+
load(key: string): string | undefined | Promise<string | undefined>;
|
|
5
|
+
remove(key: string): void | Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export declare const AuthService: Auth & {
|
|
8
|
+
setJSStorageAdapter(adapter: JSStorageAdapter | undefined): void;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,IAAI,EAKL,MAAM,cAAc,CAAC;AAKtB,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACpE,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C;AAmCD,eAAO,MAAM,WAAW,EAAE,IAAI,GAAG;IAC/B,mBAAmB,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,GAAG,IAAI,CAAC;CAoHlE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { JSStorageAdapter } from "./service";
|
|
2
|
+
/**
|
|
3
|
+
* Web AuthService with JSStorageAdapter support.
|
|
4
|
+
* On web, setStorageAdapter already accepts plain JS objects,
|
|
5
|
+
* so setJSStorageAdapter is just an alias.
|
|
6
|
+
*/
|
|
7
|
+
export declare const AuthService: {
|
|
8
|
+
name: string;
|
|
9
|
+
currentUser: import("./Auth.nitro").AuthUser | undefined;
|
|
10
|
+
grantedScopes: string[];
|
|
11
|
+
hasPlayServices: boolean;
|
|
12
|
+
login: (provider: import("./Auth.nitro").AuthProvider, options?: import("./Auth.nitro").LoginOptions) => Promise<void>;
|
|
13
|
+
logout: () => void;
|
|
14
|
+
requestScopes: (scopes: string[]) => Promise<void>;
|
|
15
|
+
revokeScopes: (scopes: string[]) => Promise<void>;
|
|
16
|
+
getAccessToken: () => Promise<string | undefined>;
|
|
17
|
+
refreshToken: () => Promise<{
|
|
18
|
+
accessToken?: string;
|
|
19
|
+
idToken?: string;
|
|
20
|
+
}>;
|
|
21
|
+
silentRestore: () => Promise<void>;
|
|
22
|
+
onAuthStateChanged: (callback: (user: import("./Auth.nitro").AuthUser | undefined) => void) => () => void;
|
|
23
|
+
onTokensRefreshed: (callback: (tokens: import("./Auth.nitro").AuthTokens) => void) => () => void;
|
|
24
|
+
setLoggingEnabled: (enabled: boolean) => void;
|
|
25
|
+
setStorageAdapter: (adapter: import("./AuthStorage.nitro").AuthStorageAdapter | undefined) => void;
|
|
26
|
+
dispose: () => void;
|
|
27
|
+
equals: (other: unknown) => boolean;
|
|
28
|
+
setJSStorageAdapter(adapter: JSStorageAdapter | undefined): void;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=service.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.web.d.ts","sourceRoot":"","sources":["../../../src/service.web.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;mBA0Co+F,CAAC;eAAiB,CAAC;;;;;;;;;iCAPh/F,gBAAgB,GAAG,SAAS;CAM1D,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ViewStyle, TextStyle } from "react-native";
|
|
3
|
+
import type { AuthProvider, AuthUser } from "../Auth.nitro";
|
|
4
|
+
interface SocialButtonProps {
|
|
5
|
+
provider: AuthProvider;
|
|
6
|
+
variant?: "primary" | "outline" | "white" | "black";
|
|
7
|
+
borderRadius?: number;
|
|
8
|
+
style?: ViewStyle;
|
|
9
|
+
textStyle?: TextStyle;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
onSuccess?: (user: AuthUser) => void;
|
|
12
|
+
onError?: (error: unknown) => void;
|
|
13
|
+
onPress?: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const SocialButton: React.FC<SocialButtonProps>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=social-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"social-button.d.ts","sourceRoot":"","sources":["../../../../src/ui/social-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAKL,SAAS,EACT,SAAS,EAEV,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAQ,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAElE,UAAU,iBAAiB;IACzB,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;IACpD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACrC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAOD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA4FpD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ViewStyle, TextStyle } from "react-native";
|
|
3
|
+
import type { AuthProvider, AuthUser } from "../Auth.nitro";
|
|
4
|
+
interface SocialButtonProps {
|
|
5
|
+
provider: AuthProvider;
|
|
6
|
+
variant?: "primary" | "outline" | "white" | "black";
|
|
7
|
+
borderRadius?: number;
|
|
8
|
+
style?: ViewStyle;
|
|
9
|
+
textStyle?: TextStyle;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
onSuccess?: (user: AuthUser) => void;
|
|
12
|
+
onError?: (error: unknown) => void;
|
|
13
|
+
onPress?: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const SocialButton: React.FC<SocialButtonProps>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=social-button.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"social-button.web.d.ts","sourceRoot":"","sources":["../../../../src/ui/social-button.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAKL,SAAS,EACT,SAAS,EAEV,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG5D,UAAU,iBAAiB;IACzB,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;IACpD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACrC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAMD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA4FpD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AuthUser, AuthProvider, LoginOptions, AuthTokens } from "./Auth.nitro";
|
|
2
|
+
export declare function useAuth(): {
|
|
3
|
+
hasPlayServices: boolean;
|
|
4
|
+
login: (provider: AuthProvider, options?: LoginOptions) => Promise<void>;
|
|
5
|
+
logout: () => void;
|
|
6
|
+
requestScopes: (newScopes: string[]) => Promise<void>;
|
|
7
|
+
revokeScopes: (scopesToRevoke: string[]) => Promise<void>;
|
|
8
|
+
getAccessToken: () => Promise<string | undefined>;
|
|
9
|
+
refreshToken: () => Promise<AuthTokens>;
|
|
10
|
+
silentRestore: () => Promise<void>;
|
|
11
|
+
user: AuthUser | undefined;
|
|
12
|
+
scopes: string[];
|
|
13
|
+
loading: boolean;
|
|
14
|
+
error: Error | undefined;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=use-auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-auth.d.ts","sourceRoot":"","sources":["../../../src/use-auth.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,UAAU,EACX,MAAM,cAAc,CAAC;AAStB,wBAAgB,OAAO;;sBASF,YAAY,YAAY,YAAY;;+BAiCH,MAAM,EAAE;mCAqBJ,MAAM,EAAE;;;;UArE1D,QAAQ,GAAG,SAAS;YAClB,MAAM,EAAE;aACP,OAAO;WACT,KAAK,GAAG,SAAS;EAwKzB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const logger: {
|
|
2
|
+
setEnabled: (value: boolean) => void;
|
|
3
|
+
log: (...args: any[]) => false | void;
|
|
4
|
+
warn: (...args: any[]) => false | void;
|
|
5
|
+
error: (...args: any[]) => false | void;
|
|
6
|
+
debug: (...args: any[]) => false | void;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../src/utils/logger.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;wBACG,OAAO;mBAGZ,GAAG,EAAE;oBACJ,GAAG,EAAE;qBACJ,GAAG,EAAE;qBACL,GAAG,EAAE;CACvB,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# NitroAuth+autolinking.cmake
|
|
3
3
|
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
# https://github.com/mrousavy/nitro
|
|
5
|
-
# Copyright ©
|
|
5
|
+
# Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
#
|
|
7
7
|
|
|
8
8
|
# This is a CMake file that adds all files generated by Nitrogen
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// NitroAuth+autolinking.gradle
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
/// This is a Gradle file that adds all files generated by Nitrogen
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// NitroAuthOnLoad.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#ifndef BUILDING_NITROAUTH_WITH_GENERATED_CMAKE_PROJECT
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# NitroAuth+autolinking.rb
|
|
3
3
|
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
# https://github.com/mrousavy/nitro
|
|
5
|
-
# Copyright ©
|
|
5
|
+
# Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
#
|
|
7
7
|
|
|
8
8
|
# This is a Ruby script that adds all files generated by Nitrogen
|
|
@@ -52,7 +52,7 @@ def add_nitrogen_files(spec)
|
|
|
52
52
|
spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
|
|
53
53
|
# Use C++ 20
|
|
54
54
|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
55
|
-
# Enables C++ <-> Swift interop (by default it's only
|
|
55
|
+
# Enables C++ <-> Swift interop (by default it's only ObjC)
|
|
56
56
|
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
57
57
|
# Enables stricter modular headers
|
|
58
58
|
"DEFINES_MODULE" => "YES",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// NitroAuth-Swift-Cxx-Bridge.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "NitroAuth-Swift-Cxx-Bridge.hpp"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// NitroAuthAutolinking.mm
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#import <Foundation/Foundation.h>
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
/// NitroAuthAutolinking.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
// TODO: Use empty enums once Swift supports exporting them as namespaces
|
|
11
|
+
// See: https://github.com/swiftlang/swift/pull/83616
|
|
8
12
|
public final class NitroAuthAutolinking {
|
|
9
13
|
public typealias bridge = margelo.nitro.NitroAuth.bridge.swift
|
|
10
14
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// AuthTokens.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
#else
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
24
|
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
25
30
|
|
|
26
31
|
|
|
27
32
|
|
|
@@ -33,7 +38,7 @@ namespace margelo::nitro::NitroAuth {
|
|
|
33
38
|
/**
|
|
34
39
|
* A struct which can be represented as a JavaScript object (AuthTokens).
|
|
35
40
|
*/
|
|
36
|
-
struct AuthTokens {
|
|
41
|
+
struct AuthTokens final {
|
|
37
42
|
public:
|
|
38
43
|
std::optional<std::string> accessToken SWIFT_PRIVATE;
|
|
39
44
|
std::optional<std::string> idToken SWIFT_PRIVATE;
|
|
@@ -42,6 +47,9 @@ namespace margelo::nitro::NitroAuth {
|
|
|
42
47
|
public:
|
|
43
48
|
AuthTokens() = default;
|
|
44
49
|
explicit AuthTokens(std::optional<std::string> accessToken, std::optional<std::string> idToken, std::optional<double> expirationTime): accessToken(accessToken), idToken(idToken), expirationTime(expirationTime) {}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
friend bool operator==(const AuthTokens& lhs, const AuthTokens& rhs) = default;
|
|
45
53
|
};
|
|
46
54
|
|
|
47
55
|
} // namespace margelo::nitro::NitroAuth
|
|
@@ -54,16 +62,16 @@ namespace margelo::nitro {
|
|
|
54
62
|
static inline margelo::nitro::NitroAuth::AuthTokens fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
55
63
|
jsi::Object obj = arg.asObject(runtime);
|
|
56
64
|
return margelo::nitro::NitroAuth::AuthTokens(
|
|
57
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "accessToken")),
|
|
58
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "idToken")),
|
|
59
|
-
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "expirationTime"))
|
|
65
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "accessToken"))),
|
|
66
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "idToken"))),
|
|
67
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "expirationTime")))
|
|
60
68
|
);
|
|
61
69
|
}
|
|
62
70
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::NitroAuth::AuthTokens& arg) {
|
|
63
71
|
jsi::Object obj(runtime);
|
|
64
|
-
obj.setProperty(runtime, "accessToken", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.accessToken));
|
|
65
|
-
obj.setProperty(runtime, "idToken", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.idToken));
|
|
66
|
-
obj.setProperty(runtime, "expirationTime", JSIConverter<std::optional<double>>::toJSI(runtime, arg.expirationTime));
|
|
72
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "accessToken"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.accessToken));
|
|
73
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "idToken"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.idToken));
|
|
74
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "expirationTime"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.expirationTime));
|
|
67
75
|
return obj;
|
|
68
76
|
}
|
|
69
77
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -74,9 +82,9 @@ namespace margelo::nitro {
|
|
|
74
82
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
75
83
|
return false;
|
|
76
84
|
}
|
|
77
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "accessToken"))) return false;
|
|
78
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "idToken"))) return false;
|
|
79
|
-
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "expirationTime"))) return false;
|
|
85
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "accessToken")))) return false;
|
|
86
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "idToken")))) return false;
|
|
87
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "expirationTime")))) return false;
|
|
80
88
|
return true;
|
|
81
89
|
}
|
|
82
90
|
};
|