when i click on the getEasy /getBasic . It goes to Log In
WHY ITS GOING TO LOGIN PAGE
and when i put shop domain and login
it gives this error
[Report Only] Refused to frame ‘https://accounts.shopify.com/’ because an ancestor violates the following Content Security Policy directive: “frame-ancestors ‘self’”.
chrome-error://chromewebdata/:1 Refused to display ‘https://accounts.shopify.com/’ in a frame because it set ‘X-Frame-Options’ to ‘deny’.
Am i doing something wrong ???
import { authenticate, MONTHLY_PLAN, ANNUAL_PLAN } from "../shopify.server";
export const loader = async ({ request }) => {
const { billing, session } = await authenticate.admin(request);
console.log("subscription api got a hit ", billing, session);
let { shop } = session;
shop = shop.replace(".myshopify.com", "");
await billing.require({
plans: [MONTHLY_PLAN],
onFailure: async () =>
billing.request({
plan: MONTHLY_PLAN,
isTest: true,
returnUrl: `https://admin.shopify.com/store/${shop}/apps/learning-app-115/app/select-plan`,
}),
});
};
const handleButtonClick = () => {
window.location.href = "/app/subscriptions";
};
<div style={{ paddingTop: "16px" }}>
<button
style={planActionButtonStyles}
onMouseEnter={(e) =>
(e.target.style.backgroundColor =
planActionButtonHoverStyles.backgroundColor)
}
onMouseLeave={(e) =>
(e.target.style.backgroundColor = "#6366f1")
}
onClick={handleButtonClick}
>
Get {plan.name}
</button>
</div>