IKEW
03/24/2022, 6:43 AMhttp://localhost:8080/auth/authorisationurl?thirdPartyId=discord
though, it just works when i go there manually. why is that and is there a fix?nkshah2
03/24/2022, 6:50 AMhttp://localhost:8080/auth/authorisationurl?thirdPartyId=discord
though, it just works when i go there manually. why is that and is there a fix?SuperTokens.init
on the frontend?IKEW
03/24/2022, 7:41 AMjs
supertokens.init({
framework: "express",
supertokens: {
// try.supertokens.com is for demo purposes. Replace this with the address of your core instance (sign up on supertokens.com), or self host a core.
connectionURI: "https://try.supertokens.com", // apiKey: "IF YOU HAVE AN API KEY FOR THE CORE, ADD IT HERE",
}, appInfo: { // learn more about this on https://supertokens.com/docs/thirdpartyemailpassword/appinfo
appName: "Exalt Panel",
apiDomain: "http://localhost:8080",
websiteDomain: "http://localhost:3000",
apiBasePath: "/auth",
websiteBasePath: '/'
}, recipeList: [
ThirdPartyEmailPassword.init({
providers: [
Discord({
clientId: '<ID>',
clientSecret: '<secret>',
scope: [
'identify',
'guilds'
]
})
]
}),
Session.init() // initializes session features
]});
js
SuperTokens.init({
appInfo: {
appName: "Exalt Panel",
apiDomain: "http://localhost:8080",
websiteDomain: "http://localhost",
apiBasePath: "/auth",
websiteBasePath: "/"
}, recipeList: [
ThirdParty.init({
signInAndUpFeature: {
getRedirectionURL: async (context) => {
if (context.action === "SUCCESS") {
if (context.redirectToPath !== undefined) {
// we are navigating back to where the user was before they authenticated
return context.redirectToPath;
}
return "/panel";
}
return undefined;
},
providers: [
{
id: "discord",
name: "Discord" // Will display "Continue with X"
}
]
}
}),
Session.init()
]});
rp
03/24/2022, 8:49 AMhttp://localhost:3000
as well.IKEW
03/24/2022, 8:50 AMrp
03/24/2022, 8:50 AMThirdPartyEmailPassword
but in the frontend, you are using ThirdParty
.
You want to initialise the same recipe on both frontend and backendIKEW
03/24/2022, 9:47 AMSuperTokens core threw an error for a POST request to path: '/recipe/signinup' with status code: 400 and message: Field name 'id' is invalid in JSON input
and the request:
{"code":
<codeHere>","thirdPartyId":"discord","redirectURI":"http://localhost:3000/callback/discord","clientId":"discord"}
rp
03/24/2022, 9:57 AMconsole.log(userIfo)
at this location: https://github.com/supertokens/supertokens-node/blob/master/lib/build/recipe/thirdparty/providers/discord.js#L75IKEW
03/24/2022, 10:29 AMat Querier.<anonymous> (D:\react-dev\exalt-web\exalt-frontend-backend\backend\node_modules\supertokens-node\lib\build\querier.js:252:31)
at Generator.throw (<anonymous>)
at rejected (D:\react-dev\exalt-web\exalt-frontend-backend\backend\node_modules\supertokens-node\lib\build\querier.js:22:44)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
rp
03/24/2022, 10:33 AMIKEW
03/24/2022, 10:34 AMrp
03/24/2022, 10:35 AMIKEW
03/24/2022, 10:37 AMrp
03/24/2022, 10:38 AMIKEW
03/24/2022, 10:38 AMrp
03/24/2022, 10:38 AMIKEW
03/24/2022, 10:51 AMrp
03/24/2022, 10:53 AMIKEW
03/24/2022, 11:16 AMrp
03/24/2022, 11:16 AMIKEW
03/24/2022, 12:52 PMjson
{
id: '576624954997604353',
username: 'IKEW',
flags: 128,
banner: null,
banner_color: null,
accent_color: null,
locale: 'en-US',
mfa_enabled: true
}
rp
03/24/2022, 1:01 PMIKEW
03/24/2022, 1:03 PMrp
03/24/2022, 1:03 PMIKEW
03/24/2022, 1:04 PMrp
03/24/2022, 1:04 PMIKEW
03/24/2022, 1:05 PMrp
03/24/2022, 1:05 PMIKEW
03/24/2022, 1:05 PMrp
03/24/2022, 1:06 PMIKEW
03/24/2022, 1:06 PMrp
03/24/2022, 1:06 PMIKEW
03/24/2022, 1:06 PMrp
03/24/2022, 1:06 PMIKEW
03/24/2022, 1:06 PMrp
03/24/2022, 1:06 PMIKEW
03/24/2022, 1:06 PMrp
03/24/2022, 1:06 PMIKEW
03/24/2022, 1:06 PM