gitcommitshow
05/02/2022, 1:25 AMSession.refreshToken
does?
How to find the references of this function. The SDK reference doesn't say much about it https://supertokens.com/docs/nodejs/modules/recipe_session.html#refreshSession-1solminded
05/02/2022, 1:33 AMCould not refresh session
error.gitcommitshow
05/02/2022, 2:24 AMITEnthusiasm
05/02/2022, 3:45 PMSuperTokens
support regular form HTTP posts? (As opposed to using json-ified data)ITEnthusiasm
05/02/2022, 4:41 PMverifySession
still work correctly? 🤔 Even when I set sessionRequired: false
, I'm getting 401s.[Manicraft1001]
05/03/2022, 9:38 AMtypescript
const initSuperTokens = () => {
supertokens.init({
framework: "express",
supertokens: {
connectionURI: "REDACTED",
apiKey: "REDACTED",
},
appInfo: {
appName: "REDACTED",
apiDomain: "http://localhost:3000",
websiteDomain: "http://localhost:3000",
apiBasePath: "/api/authentication",
websiteBasePath: "/authentication",
},
recipeList: [
ThirdPartyEmailPassword.init({
override: {
apis: (originalImplementation) => {
return {
...originalImplementation,
emailPasswordSignUpPOST: async function (input) {
if (
originalImplementation.emailPasswordSignUpPOST === undefined
) {
throw Error("Should never come here");
}
// First we call the original implementation
let response =
await originalImplementation.emailPasswordSignUpPOST(input);
console.log("response");
console.log(response);
// If sign up was successful
if (response.status === "OK") {
// We can get the form fields from the input like this
let formFields = input.formFields;
let user = response.user;
console.log(formFields);
console.log(user);
// TODO: register user in the database
// some post sign up logic
}
return response;
},
};
},
},
}),
Session.init(), // initializes session features
],
});
};
export default initSuperTokens;
NicolaiVdS
05/03/2022, 10:07 AMpsql:
image: postgres
container_name: postgress
restart: unless-stopped
ports:
- "5432:5432"
volumes:
- ./docker/psql/data:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
supertokens:
image: registry.supertokens.io/supertokens/supertokens-postgresql
container_name: supertokens
restart: unless-stopped
ports:
- 3567:3567
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRESQL_DATABASE_NAME: ${POSTGRES_DB}
depends_on:
- psql
and yes i started the db firstwdjzr
05/03/2022, 1:56 PM192.168.1.16
as the psql hostwdjzr
05/03/2022, 1:56 PMwdjzr
05/03/2022, 1:56 PM192.168.1.16
outside the docker and it works without any issueswdjzr
05/03/2022, 1:57 PMcodingtomato
05/03/2022, 2:28 PMrp
05/03/2022, 5:31 PMrp
05/03/2022, 5:31 PMΛ C Ξ L X R D
05/03/2022, 11:10 PMΛ C Ξ L X R D
05/03/2022, 11:10 PMjs
import "https://cdn.jsdelivr.net/gh/supertokens/supertokens-website/bundle/bundle.js"
supertokens.init(
{
apiDomain: "http://localhost:8000",
apiBasePath: "/auth",
onHandleEvent: (context) => {
if (context.action === "UNAUTHORISED") {
// called when the user doesn't have a valid session but made a request that requires one
// NOTE: This event can fire multiple times
if (context.sessionExpiredOrRevoked) {
// the sessionExpiredOrRevoked property is set to true if the current call cleared the session from storage
// this happens only once, even if multiple tabs sharing the same session are open, making it useful for analytics purposes
fetch("auth/session/refresh", {method: "POST"}).then(r =>{
if (r.status === 200) {
console.log("Session refreshed")
} else {
console.log("Session refresh failed")
}
})
}
}
}
});
Λ C Ξ L X R D
05/03/2022, 11:10 PMInfatuation
05/04/2022, 12:15 AMrp
05/04/2022, 4:31 AMKalibCheil
05/04/2022, 8:31 PMmarshmalon
05/04/2022, 8:37 PMmarshmalon
05/04/2022, 8:37 PMsolminded
05/04/2022, 9:58 PM/api/auth/signinup
POST? I was not able to find any documentation or examples at Supertokens repo about it. I keep getting FIELD_ERROR but no other message is available looking at the backend response.marshmalon
05/04/2022, 10:53 PMTryRefreshToken
error.
I am trying to see if I can log more information about the session using a test route that has session_required=True
but still not sure why that disparity would exist.
This error suddenly manifested after switching our domain to start using wwwnkshah2
05/05/2022, 3:18 AMnkshah2
05/05/2022, 3:24 AMnkshah2
05/05/2022, 3:28 AMaminoxix 🇮🇳
05/05/2022, 7:46 AMPitchAsh
05/05/2022, 11:55 AMPitchAsh
05/05/2022, 5:27 PM