When I click on continue with Google button it giv...
# general
a
When I click on continue with Google button it gives me following error. Please help me. recipeImplementation.js:163 GET http://localhost:3001/authorisationurl?thirdPartyId=google 404 (Not Found)
n
@User Can you post the information you pass in
appInfo
for the frontend and backend?
Also what recipes are you using?
a
social authentication + email and password authentication
n
@User Moving the conversation here (also note that I deleted your screenshots because they contained your API key in them)
Please post your SuperTokens init config again (stripping the API key)
a
Should, I post here ??
n
Yes please
a
Frontend : export function getApiDomain() { const apiPort = 3001; const apiUrl = `http://localhost:${apiPort}`; return apiUrl; } export function getWebsiteDomain() { const websitePort = 3000; const websiteUrl = `http://localhost:${websitePort}`; return websiteUrl; } SuperTokens.init({ appInfo: { appName: "Passwordless Authentication", apiDomain : getApiDomain(), websiteDomain : getWebsiteDomain(), apiBasePath: "/", websiteBasePath: "/" }, recipeList: [ ThirdPartyEmailPassword.init({ signInAndUpFeature: { providers: [Github.init(), Google.init(), Apple.init()], }, emailVerificationFeature: { mode: "REQUIRED", }, }), Session.init(), ], });
BacKend : const apiPort = 3001; const apiDomain = `http://localhost:${apiPort}`; const websitePort = 3000; const websiteDomain = `http://localhost:${websitePort}`; supertokens.init({ framework: "express", supertokens: { }, appInfo: { appName: "Passwordless Authentication", apiDomain, websiteDomain, apiBasePath: "/", websiteBasePath: "/" }, recipeList: [ ThirdPartyEmailPassword.init({ providers: [ // We have provided you with development keys which you can use for testing. // IMPORTANT: Please replace them with your own OAuth keys for production use. Google({ clientId: "1060725074195-kmeum4crr01uirfl2op9kd5acmi9jutn.apps.googleusercontent.com", clientSecret: "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" }), Github({ clientId: "467101b197249757c71f", clientSecret: "e97051221f4b6426e8fe8d51486396703012f5bd" }), Apple({ clientId: "4398792-io.supertokens.example.service", clientSecret: { keyId: "7M48Y4RYDL", privateKey: "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgu8gXs+XYkqXD6Ala9Sf/iJXzhbwcoG5dMh1OonpdJUmgCgYIKoZIzj0DAQehRANCAASfrvlFbFCYqn3I2zeknYXLwtH30JuOKestDbSfZYxZNMqhF/OzdZFTV0zc5u5s3eN+oCWbnvl0hM+9IW0UlkdA\n-----END PRIVATE KEY-----", teamId: "YWQCXGJRJL", }, }), ], }), Session.init(), ], });
there . . . ????
n
Yes give me a second, in the meantime please edit your message and remove the API key as it is sensitive information
a
I have removed connectionURI and apiKey.
rest keys I have used from supertoken docs page
n
Can you share the part of the code that adds the supertokens middleware (as explained in step 4 and 5 here: https://supertokens.com/docs/thirdpartyemailpassword/quick-setup/backend#4-add-the-supertokens-apis--cors-setup)
a
app.use( cors({ origin: websiteDomain, allowedHeaders: ["content-type", ...supertokens.getAllCORSHeaders()], methods: ["GET", "PUT", "POST", "DELETE"], credentials: true, }) ); app.use( helmet({ contentSecurityPolicy: false, }) ); app.use(middleware()); // custom API that requires session verification app.get("/sessioninfo", verifySession(), async (req, res) => { let session = req.session; res.send({ sessionHandle: session.getHandle(), userId: session.getUserId(), accessTokenPayload: session.getAccessTokenPayload(), }); }); app.use(errorHandler()); app.use((err, req, res, next) => { res.status(500).send("Internal error: " + err.message); });
n
And just to confirm, your express server is started on port 3001?
a
const websitePort = 3000; const websiteDomain = `http://localhost:${websitePort}`;
const apiPort = 3001; const apiDomain = `http://localhost:${apiPort}`;
n
I mean when you call
app.listen
a
yes app.listen(apiPort, () => console.log(
API Server listening on port ${apiPort}
)); apiPort is 3001
n
It might be easier to get on a quick call to debug this if you dont mind?
a
yeah i don't mind
please tell me how can I connect ??
n
I have DMed you a meet link
Just to summarise, the issue was that the import link for the social providers on the backend was missing
3 Views