Hi all, I'm new to SuperTokens. I'm using Passwo...
# support-questions-legacy
w
Hi all, I'm new to SuperTokens. I'm using PasswordLess authentication. I have followed the recipe. I do have a nice Sign In which is quite straightforward and works well, thanks for that! However, I don't have any *SIGN UP * and I don't get why. I added the first users through the Supertokens UI. I'm using NextJS. My back-end config is the following :
Copy code
return {
    debug: true,
    framework: "custom",
    supertokens: {
      connectionURI:
        process.env.SUPERTOKENS_URI || "https://try.supertokens.com",
      apiKey: process.env.SUPERTOKENS_API_KEY,
    },
    appInfo: appInfo("backend"),
    recipeList: [
      PasswordlessNode.init({
        flowType: "MAGIC_LINK",
        contactMethod: "EMAIL",
        emailDelivery: {...}
      }),
      SessionNode.init(),
      Dashboard.init(),
      UserRoles.init(),
      UserMetadata.init(),
    ],
    isInServerlessEnv: true,
  };
};
Could somebody help me?
r
hey @wendytrns the UI for sign in and sign up is the same for passwordles login recipe
w
Yes indeed thanks! But when submitting the email no user is created in my DB. Should I trigger it myself?
r
Are you using self hosted core?
w
No, managed service. But I can see the content of the database through the UI and it's not in there
r
huh?
w
Simple question : With passwordless setup, if my email is not found in the SuperTokens users database, what happens? Does it create a user? Or should I override something in the Recipe for the user object to be created?
r
it does create a new user indeed
w
It does not in my case. What could I have done wrong ?
r
im prettyy sure it would. Im not sure what error you face, or what your setup is. So hard to help. I fyou can be very specific about the issue, we can help.
w
Thanks, I'll develop. Most of my code is essentially the same as in the recipes from the NextJS ST docs. So I have this config :
Copy code
export const backendConfig = (): TypeInput => {
  return {
    debug: true,
    framework: "custom",
    supertokens: {
      connectionURI: process.env.SUPERTOKENS_URI,
      apiKey: process.env.SUPERTOKENS_API_KEY,
    },
    appInfo: appInfo("backend"),
    recipeList: [
      PasswordlessNode.init({
        flowType: "MAGIC_LINK",
        contactMethod: "EMAIL",
      }),
      SessionNode.init(),
      Dashboard.init(),
      UserRoles.init(),
      UserMetadata.init(),
    ],
    isInServerlessEnv: true,
  };
};
And a sign-in/up route with this component :
Copy code
export default function Auth() {
  const [loaded, setLoaded] = useState(false);
  useEffect(() => {
    if (SuperTokens.canHandleRoute(PreBuiltUIList) === false) {
      redirectToAuth({ redirectBack: false });
    } else {
      setLoaded(true);
    }
  }, []);

  if (loaded) {
    return SuperTokens.getRoutingComponent(PreBuiltUIList);
  }

  return null;
}
Then I'm in front of the component in screenshot. When I enter an email address which is not in the database yet, it does not create a user in my SuperTokens database (which I preview at
http://localhost:3000/api/auth/dashboard/
.).
r
right. I see.
What shows up in the dashboard?
can you send a screenshot of the dashboard you see?
w
Yes, I see this 🙂
r
right. So there are 4 users.
are you saying that you added a new, 5th user, and that didn't show up?
also, is the timejoined showing correctly?
w
I'm saying that when on the sign in component (see screeshot earlier), when entering an email and clicking 'Se connecter', it should have created a user (what you say) and it did not
Yes the dates are correct
r
it would create a user when the OTP / magic link is entered correctly
w
Ah! That's what I miss I think. I have some custom email sending and I may have an error there
Thanks a lot! Nice to see some reactions on the questions 😄 Have a nice evening! I'll tell you if it's successful
7 Views