Binouse
09/01/2022, 3:16 PMenvironment:
section but it is not considered. Am I doing it wrong ?JacobLUC
09/01/2022, 3:48 PMgiorgosera
09/01/2022, 4:33 PMjavascript
const providers = connections.map(({ id, authUrl, tokenUrl, clientId, clientSecret, scopes }) => {
return {
id,
get: (redirectURI: undefined | string, authCodeFromRequest: undefined | string) => {
return {
accessTokenAPI: {
url: tokenUrl,
params: {
client_id: clientId,
client_secret: clientSecret,
grant_type: "authorization_code",
redirect_uri: process.env.AUTH_SUCCESS_REDIRECT_URI,
code: authCodeFromRequest || '',
}
},
authorisationRedirect: {
url: authUrl,
params: {
client_id: clientId,
scope: scopes,
response_type: "code",
redirect_uri: process.env.AUTH_SUCCESS_REDIRECT_URI,
}
},
getClientId: () => clientId,
getProfileInfo: async (accessTokenAPIResponse: any) => {
console.log(accessTokenAPIResponse);
return {
id: "...",
};
}
}
}
}
});
I can successfully login with a provider and I can see I can get redirected to the process.env.AUTH_SUCCESS_REDIRECT_URI
. But the code inside getProfileInfo
is never called.
Also, I have followed the guide (https://supertokens.com/docs/thirdparty/common-customizations/getting-provider-access-token) to get the provider access token but that doesn't get called either.
What am I doing wrong?nilinswap
09/02/2022, 5:03 AMnpm run build-pretty
nilinswap
09/02/2022, 5:03 AM> cd lib && rm -rf build && npx tsc -p tsconfig.json && cd ../test/with-typescript && npx tsc -p tsconfig.json --noEmit && cd ../.. && npm run post-build
ts/framework/express/framework.ts:148:18 - error TS2430: Interface 'SessionRequest' incorrectly extends interface 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>'.
Types of property 'session' are incompatible.
Type 'SessionContainerInterface | undefined' is not assignable to type 'Session & Partial<SessionData>'.
Type 'undefined' is not assignable to type 'Session & Partial<SessionData>'.
Type 'undefined' is not assignable to type 'Session'.
148 export interface SessionRequest extends Request {
~~~~~~~~~~~~~~
ts/recipe/session/framework/express.ts:24:44 - error TS2345: Argument of type 'SessionRequest' is not assignable to parameter of type 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>'.
Types of property 'session' are incompatible.
Type 'SessionContainerInterface | undefined' is not assignable to type 'Session & Partial<SessionData>'.
Type 'undefined' is not assignable to type 'Session & Partial<SessionData>'.
24 const request = new ExpressRequest(req);
~~~
Found 2 errors.
nilinswap
09/02/2022, 5:05 AMnpm i -D @types/express-serve-static-core
and skipLibCheck is already true. nothing worked. any ideas on how to fix this?rp
09/02/2022, 5:15 AMAbdul Hakkeem P A
09/02/2022, 4:11 PMJatinder
09/03/2022, 8:44 AMO2K
09/03/2022, 8:52 AMrp
09/03/2022, 9:07 AMrp
09/03/2022, 9:09 AMnickm91
09/03/2022, 11:38 AMrp
09/03/2022, 12:46 PMArjun
09/03/2022, 3:54 PMflow-wizard
09/04/2022, 6:59 AMrp
09/04/2022, 7:57 AMSOMEBODYAWFUL
09/04/2022, 8:27 PMkenny
09/05/2022, 1:23 AMrp
09/05/2022, 3:30 AMrp
09/05/2022, 3:30 AMfunk101
09/05/2022, 11:12 AMerror - unhandledRejection: Error: Initialisation not done. Did you forget to call the SuperTokens.init function?
funk101
09/05/2022, 11:12 AMidanh
09/05/2022, 11:32 AMhttps://supertokens.com/docs/thirdpartyemailpassword/common-customizations/redirecting-post-login
but after the user completes log in (with google) the context.redirectToPath
is undefined and so this flow doesn't work
i'm using react-router-dom and in case a session doesn't exist I use your api ( redirectToAuth
) to redirect the user to auth screen
also, i couldn't find something similar with the Session recipe which i would like to support as wellDeleted User
09/05/2022, 8:34 PMemailDelivery
as specified in the above-linked article.
Could you please help take a look at this?
Type - Supertoken NodeJS
Version - 11.3.0rp
09/06/2022, 2:58 AMIaS1506
09/06/2022, 6:36 AMrp
09/06/2022, 6:36 AMshri
09/06/2022, 9:22 AMBinouse
09/06/2022, 10:36 AM