Alen
10/20/2022, 6:12 AMnkshah2
10/20/2022, 6:15 AMAlen
10/20/2022, 6:17 AMnkshah2
10/20/2022, 6:17 AMAlen
10/20/2022, 6:18 AMnkshah2
10/20/2022, 6:18 AMAlen
10/20/2022, 6:18 AMnkshah2
10/20/2022, 6:24 AMPasswordless.createCode
for example) you can use the preApiHook
feature to pass additional params
It would look similar to this
Passwordless.createCode({
email: "", // or phone
options: {
preAPIHook: async (input) => {
// Modify input.requestInit
return {
url: input.url,
requestInit: input.requestInit
};
},
},
})
This way you can customise the payload, url etc of the network requestAlen
10/20/2022, 6:49 AMnkshah2
10/20/2022, 6:49 AMrp
10/20/2022, 7:16 AMAlen
10/20/2022, 7:17 AMemailDelivery: {
override: (originalImplementation) => {
return {
...originalImplementation,
sendEmail: async function ({
codeLifetime, // amount of time the code is alive for (in MS)
email,
urlWithLinkCode, // magic link
userInputCode, // OTP
}) {}
rp
10/20/2022, 8:15 AMAlen
10/20/2022, 9:19 AMError: Please provide a valid sessionScope
Could you please help me with this issue.rp
10/20/2022, 10:23 AMtypeof window !== "undefined"
Alen
10/20/2022, 10:33 AMawait Session.getUserId()
, Should this also be run in frontend only ?rp
10/20/2022, 11:08 AMAlen
10/21/2022, 3:04 AMrp
10/21/2022, 3:15 AMAlen
10/21/2022, 9:04 AMrp
10/21/2022, 9:05 AMAlen
10/21/2022, 9:05 AMrp
10/21/2022, 9:06 AMAlen
10/21/2022, 9:07 AMrp
10/21/2022, 9:08 AMAlen
10/21/2022, 9:08 AMrp
10/21/2022, 9:48 AMAlen
10/21/2022, 9:48 AMrp
10/21/2022, 9:48 AMAlen
10/21/2022, 9:48 AMrp
10/21/2022, 9:49 AMAlen
10/21/2022, 9:50 AMrp
10/21/2022, 9:51 AMAlen
10/21/2022, 9:51 AMrp
10/21/2022, 9:52 AMAlen
10/21/2022, 9:52 AMrp
10/21/2022, 9:52 AMAlen
10/21/2022, 9:53 AMrp
10/21/2022, 9:53 AMAlen
10/21/2022, 9:53 AMrp
10/21/2022, 9:54 AMAlen
10/21/2022, 9:54 AMrp
10/21/2022, 9:54 AMAlen
10/21/2022, 9:54 AMrp
10/21/2022, 9:54 AMAlen
10/21/2022, 10:34 AMrp
10/21/2022, 10:39 AMAlen
10/21/2022, 10:46 AMrp
10/21/2022, 10:53 AMAlen
10/21/2022, 10:54 AMrp
10/21/2022, 10:54 AMAlen
10/25/2022, 3:50 AMawait Session.signout()
it's not clearing the cookies properly. Due to which when I check if Session exist or not it returns true and takes me to dashboard.rp
10/25/2022, 4:05 AMAlen
10/25/2022, 4:05 AMrp
10/25/2022, 4:05 AMAlen
10/25/2022, 4:06 AMrp
10/25/2022, 11:46 AMAlen
10/25/2022, 11:48 AMawait Session.signout()
function from frontend.rp
10/25/2022, 11:49 AMAlen
10/25/2022, 11:51 AMrp
10/25/2022, 11:52 AMAlen
10/25/2022, 11:54 AMrp
10/25/2022, 11:55 AMAlen
10/25/2022, 11:55 AMrp
10/25/2022, 11:56 AMAlen
10/25/2022, 11:58 AMrp
10/25/2022, 11:58 AMAlen
10/25/2022, 12:01 PMrp
10/25/2022, 12:03 PMAlen
10/25/2022, 12:03 PMnkshah2
10/25/2022, 12:17 PMAlen
10/25/2022, 12:17 PMSuperTokens.init({
appInfo: {
apiDomain: Constants.SUPERTOKENS_SVC_URL,
apiBasePath: "/auth",
appName: "blocksurvey",
},
recipeList: [
Session.init(),
Passwordless.init()
],
});
supertokens.init({
framework: 'express',
supertokens: {
// These are the connection details of the app you created on supertokens.com
connectionURI: config.supertokensConfig.connection_url,
apiKey: config.supertokensConfig.api_key,
},
appInfo: {
// learn more about this on https://supertokens.com/docs/session/appinfo
appName: 'blocksurvey',
apiDomain: apiDomain,
websiteDomain: websiteDomain,
apiBasePath: '/auth',
websiteBasePath: '/signin',
},
recipeList: [
Passwordless.init({
flowType: 'USER_INPUT_CODE_AND_MAGIC_LINK',
contactMethod: 'EMAIL',
nkshah2
10/25/2022, 12:21 PMConstants.SUPERTOKENS_SVC_URL
on the frontend and websiteDomain
on the backend?Alen
10/25/2022, 12:22 PMrp
10/25/2022, 12:29 PMAlen
10/25/2022, 12:33 PMrp
10/25/2022, 12:33 PMAlen
10/25/2022, 12:34 PMrp
10/25/2022, 12:37 PMAlen
10/25/2022, 12:39 PMrp
10/25/2022, 12:39 PMAlen
10/25/2022, 12:43 PMrp
10/25/2022, 12:45 PMAlen
10/25/2022, 12:47 PMrp
10/25/2022, 12:54 PMAlen
10/25/2022, 12:59 PMrp
10/25/2022, 1:11 PMAlen
10/25/2022, 1:15 PMrp
10/26/2022, 7:19 AMAlen
10/26/2022, 7:21 AMrp
10/26/2022, 7:21 AMAlen
10/26/2022, 7:21 AMAlen
10/26/2022, 7:24 AM"supertokens-auth-react/recipe/passwordless"
. Instead I use supertokens-web-js/recipe/passwordless
. Will it create any issue?rp
10/26/2022, 7:27 AMAlen
10/26/2022, 7:28 AMrp
10/26/2022, 7:29 AMts
Passwordless.createCode({
email: "...",
options: {
preAPIHook: async (context) => {
// TODO: modify request body in context
return context;
}
}
})
Alen
10/26/2022, 7:29 AMrp
10/26/2022, 7:30 AMcreateCode
functionAlen
10/26/2022, 7:30 AMrp
10/26/2022, 7:33 AMAlen
10/26/2022, 7:34 AMhttp://localhost:4200/signin?rid=passwordless&preAuthSessionId=WvK4-jhGS2O1zIc13Ba7P1nhu-HuZ_BCLDQqC-djGTY=#yvtA3M0PM2sl3Qhi-3j2CYEZy1OXqE5uNFr3brzU5A4=&redirectTo=true
I have added an extra query param redirectTo=true
. But while validating the url and consuming it. The backend is throwing an error :
Error: SuperTokens core threw an error for a POST request to path: '/recipe/signinup/code/consume' with status code: 400 and message: Input encoding error in linkCode
at Querier.<anonymous> (C:\supertoken-function\node_modules\supertokens-node\lib\build\querier.js:252:31)
at Generator.throw (<anonymous>)
at rejected (C:\supertoken-function\node_modules\supertokens-node\lib\build\querier.js:22:44)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
rp
10/26/2022, 8:57 AMAlen
10/26/2022, 8:58 AMrp
10/26/2022, 8:59 AMAlen
10/26/2022, 8:59 AMhttp://localhost:4200/signin?redirectTo=true&rid=passwordless&preAuthSessionId=WvK4-jhGS2O1zIc13Ba7P1nhu-HuZ_BCLDQqC-djGTY%3D#yvtA3M0PM2sl3Qhi-3j2CYEZy1OXqE5uNFr3brzU5A4&=
rp
10/26/2022, 9:01 AMAlen
10/26/2022, 9:02 AMrp
10/26/2022, 9:02 AMAlen
10/26/2022, 9:02 AMrp
10/26/2022, 9:03 AMAlen
10/26/2022, 9:03 AMrp
10/26/2022, 9:04 AMAlen
11/24/2022, 8:04 AM{
status: "failed",
message: "Access token has expired. Please call the refresh API"
}
rp
11/24/2022, 8:15 AM