hi,
@prateek_surana
I am able to signup, but the below
http://localhost:3001/auth/signinup
is getting called twice,
for first time it is giving 200
but for the second time it is giving 500,
React.useEffect(() => {
const handleGoogleCallback = async () => {
try {
const response = await thirdPartySignInAndUp();
if (response.status === "OK") {
console.log(response.user);
if (
response.createdNewRecipeUser &&
response.user.loginMethods.length === 1
) {
// sign up successful
} else {
// sign in successful St-Access-Token St-Refresh-Token
}
console.log("response", response);
navigate(
/auth/home_screen?access_token=${response.fetchResponse.headers.get('st-access-token')}&refresh_token=${response.fetchResponse.headers.get('st-refresh-token')}
);
} else if (response.status === "SIGN_IN_UP_NOT_ALLOWED") {
// this can happen due to automatic account linking. Please see our account linking docs
} else {
window.alert(
"No email provided by social login. Please use another form of login"
);
navigate("/auth"); // redirect back to login page
}
} catch (err) {
if (err.isSuperTokensGeneralError === true) {
} else {
console.log("err", err);
window.alert("Oops! Something went wrong.");
}
}
};
handleGoogleCallback();
}, [])
and I am getting error on backed
Error: Received response with status 400 and body {
"error": "invalid_grant",
"error_description": "Bad Request"
}
at Object.exchangeAuthCodeForOAuthTokens (C:\Projects\dh-prajavani-auth\api\node_modules\supertokens-node\lib\build\recipe\thirdparty\providers\custom.js:259:23)
on page load I am calling this effect,
can you help here