Browser Sign in alert triggered when retrieving session token in AppBridge

Browser Sign in alert triggered when retrieving session token in AppBridge

mcohen
Shopify Partner
11 0 0

mcohen_0-1743791538649.png

Hi everyone, I started noticing this sign in alert is triggered when trying obtain a token from AppBridge, in my react app.

 

export function Auth() {
const shopify = useAppBridge();
const navigate = useNavigate();

useEffect(() => {
shopify.idToken().then((token) => {
// console.log("Session token: ", token);
 });
}, [navigate, shopify]);

 

I use this token to communicate with my backend, and the backend validates this token to make sure it comes from Shopify. 
Anybody knows how to avoid this? I'm logged into the shop using the app, why am I prompted to log in again?

Replies 0 (0)