shashank0959
02/20/2024, 7:28 AMrp_st
02/20/2024, 8:02 AMshashank0959
02/20/2024, 8:03 AMshashank0959
02/20/2024, 8:23 AMrp_st
02/20/2024, 8:45 AMshashank0959
02/20/2024, 11:17 AMshashank0959
02/20/2024, 11:18 AMshashank0959
02/20/2024, 11:19 AMrp_st
02/20/2024, 11:24 AMrp_st
02/20/2024, 11:24 AMshashank0959
02/20/2024, 11:31 AM<ParentComponenet>
<GoogleOneTapLogin
onSuccess={doLogin}
googleAccountConfigs={{
client_id:
"my_id",
prompt_parent_id: "google-onetap-container",
cancel_on_tap_outside: false,
}}
/>
<SocialLogin/>
</ParentComponent>
can you suggest, at what steps I am doing wrong.?rp_st
02/20/2024, 11:55 AMsattvikc
02/20/2024, 11:57 AMsattvikc
02/20/2024, 12:01 PM<div id="google-onetap-container"></div>
shashank0959
02/20/2024, 12:13 PMclient:48 [GSI_LOGGER]: The given origin is not allowed for the given client ID.
and
GET https://accounts.google.com/gsi/status?client_id=997955211260-7sno3fvvbgmbmpfk0.apps.googleusercontent.com&as=S3VXo5FH%2BR3lHeiZxYkjbw 403 (Forbidden)
sattvikc
02/20/2024, 12:18 PMshashank0959
02/20/2024, 12:37 PMGET https://accounts.google.com/gsi/status?client_id=997955211260-7sno3fvvbgmbmpfk0.apps.googleusercontent.com&as=S3VXo5FH%2BR3lHeiZxYkjbw 403 (Forbidden)
sattvikc
02/20/2024, 12:38 PMshashank0959
02/20/2024, 1:01 PMsattvikc
02/20/2024, 1:02 PMhttp://localhost
if you are testing it from localhostshashank0959
02/20/2024, 1:03 PMsattvikc
02/20/2024, 1:07 PMshashank0959
02/21/2024, 7:14 AMError: Auth state verification failed. The auth provider responded with an invalid state
can you help here, what needs to be done on backend side, pleasesattvikc
02/21/2024, 7:16 AMshashank0959
02/21/2024, 7:23 AMsattvikc
02/21/2024, 7:23 AMshashank0959
02/21/2024, 7:24 AMshashank0959
02/21/2024, 7:25 AMconst doLogin = async (data) => {
console.log("data", data);
if (data.credential) {
// we do this call so that the state is created and saved in storage.
await getThirdPartyAuthorisationURLWithQueryParamsAndSetState({
thirdPartyId: "google",
frontendRedirectURI: window.location.toString(),
});
const stateInfo = await getThirdPartyStateAndOtherInfoFromStorage();
console.log("stateInfo", stateInfo);
if (data.credential && stateInfo !== undefined) {
const response = await thirdPartySignInAndUp({
userContext: {
id_token: data.credential,
state: stateInfo.stateForAuthProvider,
},
});
console.log("response", response);
document.location.href = "/";
}
}
};
please ignor consolesattvikc
02/21/2024, 7:28 AMsattvikc
02/21/2024, 7:29 AMsattvikc
02/21/2024, 7:30 AMshashank0959
02/21/2024, 7:30 AMsattvikc
02/21/2024, 7:30 AMshashank0959
02/21/2024, 8:03 AMpreAPIHook: async (context) => {
if (context.action === "THIRD_PARTY_SIGN_IN_UP") {
if (typeof context.requestInit.body !== "string") {
throw new Error("should not happen");
}
let body = JSON.parse(context.requestInit.body);
body!.redirectURIInfo = undefined;
body!.oAuthTokens = { id_token: context.userContext.id_token };
context.requestInit.body = JSON.stringify(body);
}
return context;
},
this as well?shashank0959
02/21/2024, 8:05 AMThirdPartyPasswordless.init({
preAPIHook: async (context) => {
let url = context.url;
// is the fetch config object that contains the header, body etc..
let requestInit = context.requestInit;
let action = context.action;
console.log("actions", context);
if (action === "EMAIL_EXISTS") {
} else if (action === "PASSWORDLESS_CONSUME_CODE") {
} else if (action === "PASSWORDLESS_CREATE_CODE") {
} else if (action === "PASSWORDLESS_RESEND_CODE") {
} else if (action === "PHONE_NUMBER_EXISTS") {
}
// events such as sign out are in the
// session recipe pre API hook (See the info box below)
return {
requestInit,
url,
};
},
override: {
functions: (oI) => {
return {
...oI,
getThirdPartyAuthStateFromURL: (input) => {
if (input.userContext.state) {
return input.userContext.state;
}
return oI.getThirdPartyAuthStateFromURL(input);
},
};
},
},
}),
sattvikc
02/21/2024, 8:56 AMsattvikc
02/21/2024, 8:57 AMshashank0959
02/21/2024, 8:57 AMsattvikc
02/21/2024, 8:58 AMshashank0959
02/21/2024, 8:58 AMsattvikc
02/21/2024, 8:58 AMshashank0959
02/21/2024, 8:59 AMsattvikc
02/21/2024, 8:59 AMshashank0959
02/21/2024, 8:59 AMsattvikc
02/21/2024, 9:01 AMpreAPIHook: async (context) => {
if (context.action === "THIRD_PARTY_SIGN_IN_UP") {
if (context.userContext.id_token !== undefined) {
if (typeof context.requestInit.body !== "string") {
throw new Error("should not happen");
}
let body = JSON.parse(context.requestInit.body);
body!.redirectURIInfo = undefined;
body!.oAuthTokens = { id_token: context.userContext.id_token };
context.requestInit.body = JSON.stringify(body);
}
}
return context;
},