Skip to content

Commit 1ae3ceb

Browse files
fix: make auth optional for present
1 parent b0c3aaf commit 1ae3ceb

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

sample/src/screens/CartScreen.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import {
3232
ActivityIndicator,
3333
Pressable,
3434
RefreshControl,
35-
Alert,
3635
} from 'react-native';
3736
import Icon from 'react-native-vector-icons/Entypo';
3837

@@ -87,14 +86,10 @@ function CartScreen(): React.JSX.Element {
8786

8887
const presentCheckout = async () => {
8988
if (checkoutURL) {
90-
const auth = await fetchToken();
91-
if (!auth) {
92-
Alert.alert('Error', 'Failed to authenticate');
93-
return;
94-
}
89+
const token = await fetchToken();
9590

9691
ShopifyCheckout.present(checkoutURL, {
97-
authentication: { token: auth },
92+
authentication: token ? { token } : undefined,
9893
});
9994
}
10095
};

0 commit comments

Comments
 (0)