I'm looking to implement discord oAuth in NextJS and noticed SuperTokens had a recipe for Discord in...
n
I'm looking to implement discord oAuth in NextJS and noticed SuperTokens had a recipe for Discord in the backend libraries (supertokens-node and supertokens-go) but not in the frontend (supertokens-react) Would this mean I would have to send a http request to
/authorisationurl?thirdPartyId=discord
?
r
You could add:
Copy code
{id: "discord", name: "Discord"}
to the providers list on the frontend and then you would see a button that would work with the discord available on the backend
n
Thanks!
r
And if you want to add a custom UI to that button, then you can do:
Copy code
{
  id: "discord",
  name: "Discord",
  buttonComponent: () => {
    return <div>...</div>
  }
}
n
coming from next-auth where there are events such as
Copy code
createUser
Sent when the adapter is told to create a new user.
Is it possible to execute code serverside in an api route when a new account is created?
r
Yes
Which recipe are you using?
The above is for thirdpartyemailpassword recipe. If you are using another, please navigate to a similar section in the other recipe
2 Views