@authara/react-native 0.2.0 → 0.2.1
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/dist/buttons.d.ts +1 -0
- package/dist/buttons.js +2 -2
- package/dist/nitro-google-signin.js +2 -1
- package/package.json +4 -4
package/dist/buttons.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export interface GoogleButtonVisualProps extends AutharaButtonVisualProps {
|
|
|
28
28
|
border?: boolean;
|
|
29
29
|
shape?: "pill" | "circle" | "square" | "rectangular";
|
|
30
30
|
logoAlignment?: "left" | "center";
|
|
31
|
+
onCancel?: () => void;
|
|
31
32
|
}
|
|
32
33
|
export interface AppleButtonVisualProps extends AutharaButtonVisualProps {
|
|
33
34
|
locale?: string;
|
package/dist/buttons.js
CHANGED
|
@@ -99,12 +99,12 @@ function ProviderButton({ provider, providerLabel, action, audience, authenticat
|
|
|
99
99
|
}
|
|
100
100
|
export function GoogleButton(props) {
|
|
101
101
|
const internal = props;
|
|
102
|
-
const { action = "login", audience, authenticationChallengeId, recoveryLinkId, onSuccess, onError, variant = "text", size = "large", label = action === "login" ? "sign-in" : "continue", mode = "light", theme, border, shape = "rectangular", logoAlignment = "center", buttonText, width, locale, ...buttonProps } = internal;
|
|
102
|
+
const { action = "login", audience, authenticationChallengeId, recoveryLinkId, onSuccess, onError, onCancel, variant = "text", size = "large", label = action === "login" ? "sign-in" : "continue", mode = "light", theme, border, shape = "rectangular", logoAlignment = "center", buttonText, width, locale, ...buttonProps } = internal;
|
|
103
103
|
void locale;
|
|
104
104
|
const resolvedMode = useResolvedColorMode(mode);
|
|
105
105
|
const visibleLabel = buttonText ??
|
|
106
106
|
(variant === "provider" ? "Google" : autharaButtonLabel(label, "Google"));
|
|
107
|
-
return (_jsx(ProviderButton, { ...buttonProps, provider: "google", providerLabel: "Google", action: action, audience: audience, authenticationChallengeId: authenticationChallengeId, recoveryLinkId: recoveryLinkId, onSuccess: onSuccess, onError: onError, variant: variant, label: visibleLabel, appearance: googleButtonAppearance({
|
|
107
|
+
return (_jsx(ProviderButton, { ...buttonProps, provider: "google", providerLabel: "Google", action: action, audience: audience, authenticationChallengeId: authenticationChallengeId, recoveryLinkId: recoveryLinkId, onSuccess: onSuccess, onError: onError, onCancel: onCancel, variant: variant, label: visibleLabel, appearance: googleButtonAppearance({
|
|
108
108
|
variant,
|
|
109
109
|
size,
|
|
110
110
|
width,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GoogleOneTapSignIn, isCancelledResponse, isSuccessResponse, } from "react-native-nitro-google-signin";
|
|
2
2
|
import { Platform } from "react-native";
|
|
3
|
+
import { AutharaProviderCancellationError } from "./button-error.js";
|
|
3
4
|
export function createNitroGoogleSignIn(config = {}) {
|
|
4
5
|
return {
|
|
5
6
|
async authorize(options) {
|
|
@@ -15,7 +16,7 @@ export function createNitroGoogleSignIn(config = {}) {
|
|
|
15
16
|
await GoogleOneTapSignIn.checkPlayServices(true);
|
|
16
17
|
const response = await GoogleOneTapSignIn.presentExplicitSignIn();
|
|
17
18
|
if (isCancelledResponse(response)) {
|
|
18
|
-
throw new
|
|
19
|
+
throw new AutharaProviderCancellationError("Google");
|
|
19
20
|
}
|
|
20
21
|
if (!isSuccessResponse(response) || !response.data.idToken) {
|
|
21
22
|
throw new Error("Google did not return an ID token");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authara/react-native",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Official React Native client, hooks, and native-provider buttons for Authara",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authentication",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"prepublishOnly": "npm run check:generated && npm run build"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"expo-apple-authentication": ">=7 <9",
|
|
74
|
-
"expo-auth-session": ">=6 <8",
|
|
75
|
-
"expo-secure-store": ">=14 <16",
|
|
73
|
+
"expo-apple-authentication": ">=7 <9 || >=56 <58",
|
|
74
|
+
"expo-auth-session": ">=6 <8 || >=56 <58",
|
|
75
|
+
"expo-secure-store": ">=14 <16 || >=56 <58",
|
|
76
76
|
"react": "^18.0.0 || ^19.0.0",
|
|
77
77
|
"react-native": ">=0.76",
|
|
78
78
|
"react-native-nitro-google-signin": ">=2 <3",
|