https://supertokens.com/ logo
n

not herdie

04/12/2022, 10:32 AM
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

rp

04/12/2022, 10:36 AM
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

not herdie

04/12/2022, 10:37 AM
Thanks!
r

rp

04/12/2022, 10:38 AM
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

not herdie

04/12/2022, 8:31 PM
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

rp

04/13/2022, 2:55 AM
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