I am using sign-in with apple using the following link in Nuxt app:
https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js
So the problem is if I don't use usePopup flag and use the server link with redirectURI then apple does makes a post request to redirectURI then request completes successfully but I can't get the data from the server. and If I use the usePopup: true then I have to do the post request to the server then it fails (apple response: invalid request) I am using expressjs as a server.
AppleID.auth.init({
clientId: "my-client-id", // This is the service ID we created.
scope: "name email", // To tell apple we want the user name and emails fields in the response it sends us.
redirectURI: "https://9b29-103-213-105-122.in.ngrok.io/login", // As registered along with our service ID
state: "origin:web", // Any string of your choice that you may use for some logic. It's optional and you may omit it.
usePopup: true, // Important if we want to capture the data apple sends on the client side.
});
then after the response from the following code I make the post request:
this.appleResponse = await AppleID.auth.signIn();