bolg55
03/20/2024, 6:28 AM[06:04:29.440] INFO: incoming request
reqId: "req-6"
req: {
"method": "POST",
"url": "/api/auth/signinup/code/consume",
"hostname": "<URL>.railway.app",
"remoteAddress": "192.168.0.4",
"remotePort": 42904
}
[06:04:29.494] INFO: incoming request
reqId: "req-7"
req: {
"method": "POST",
"url": "/api/auth/signinup/code/consume",
"hostname": "<URL>.railway.app",
"remoteAddress": "192.168.0.3",
"remotePort": 52334
}
I am using React, but following using hte supertokens-web-js, maybe this is part of my mistake? I just wasn't sure how to implement the react version with my own UI.
Code:
typescript
export const handleMagicLinkClicked = async () => {
try {
const response = await consumePasswordlessCode();
if (response.status === 'OK') {
await clearPasswordlessLoginAttemptInfo();
if (
response.createdNewRecipeUser &&
response.user.loginMethods.length === 1
) {
toast.success('Account created successfully. Welcome!');
} else {
toast.success('Login successful. Welcome back!');
}
return 'success';
} else {
await clearPasswordlessLoginAttemptInfo();
toast.error('Login failed. Please try again');
return 'failed';
}
} catch (error: unknown) {
if (isSuperTokensError(error)) {
toast.error(error.message);
} else {
toast.error('Something went wrong');
return 'error';
}
}
};
Any help would be appreciated. I am very stumped