Killian
08/17/2022, 5:25 AMadyus
08/17/2022, 4:39 PMsIRTFrontend
keeps getting reset to remove
after logging in. I'm using code from the Vue.js example included in the web-js repo (https://github.com/supertokens/supertokens-web-js/tree/master/examples/vuejs/with-thirdpartyemailpassword), but with EmailPassword instead of ThirdPartyEmailPassword. That's the only code change from the sample>
I'm using a Python backend using FastAPI, running on http://localhost:8000
. Frontend is running at http://localhost:8080
. Here are my settings:
Frontend:
js
VITE_API_URL=http://localhost:8000
VITE_API_BASEPATH=/api/v1/auth
VITE_WEB_URL=http://localhost:8080
js
const apiDomain = import.meta.env.VITE_API_URL;
const apiBasePath = import.meta.env.VITE_API_BASEPATH;
SuperTokens.init({
appInfo: {
appName: "Test",
apiDomain,
apiBasePath,
},
recipeList: [Session.init(), EmailPassword.init()],
// enableDebugLogs: true,
});
Backend:
python
SUPERTOKENS_URL = os.environ.get("SUPERTOKENS_URL", "http://localhost:3567")
SUPERTOKENS_API_KEY = os.environ.get("SUPERTOKENS_API_KEY", "someRandomKey")
SUPERTOKENS_WEBSITE_DOMAIN = os.environ.get(
"SUPERTOKENS_WEBSITE_DOMAIN", "http://localhost:8080"
)
SUPERTOKENS_API_DOMAIN = os.environ.get(
"SUPERTOKENS_API_DOMAIN", "http://localhost:8000"
)
python
supertokens_init(
app_info=InputAppInfo(
app_name="Test",
api_domain=SUPERTOKENS_API_DOMAIN,
website_domain=SUPERTOKENS_WEBSITE_DOMAIN,
api_base_path="/api/v1/auth", # Remember to set this on the frontend as well
),
supertokens_config=SupertokensConfig(
connection_uri=SUPERTOKENS_URL, api_key=SUPERTOKENS_API_KEY
),
framework="fastapi",
recipe_list=[
st_session.init(), # initializes session features
st_emailpassword.init(),
st_userroles.init(),
],
mode="asgi",
)
thethiny
08/17/2022, 11:16 PMthethiny
08/17/2022, 11:16 PMrp
08/18/2022, 3:19 AMKillian
08/18/2022, 5:19 AMjavascript
console.log(credential.authorizationCode);
await axios
.post(
`${API_DOMAIN}/auth/signinup`,
{
redirectURI: "com.demoapp:/oauthredirect",
thirdPartyId: "apple",
code: credential.authorizationCode,
clientId: MY CLIENT ID.
},
{
headers: {
rid: "thirdpartyemailpassword",
},
}
)
EdwinN1337
08/18/2022, 9:26 AMnkshah2
08/18/2022, 10:00 AMsurajpalai
08/18/2022, 12:06 PMutku
08/18/2022, 1:16 PMNicolasAlt
08/18/2022, 3:42 PMNicolasAlt
08/18/2022, 3:42 PMNicolasAlt
08/18/2022, 3:44 PMNicolasAlt
08/18/2022, 3:49 PMrp
08/18/2022, 3:57 PMaV
08/18/2022, 4:02 PMgo
// add the account id to the user's supertoken metadata
_, err = usermetadata.UpdateUserMetadata(req.UserId, map[string]interface{}{
"account_id": newAcc.Id,
})
if err != nil {
logx.Errorf("error updating user metadata: %v", err)
return nil, xerr.UpdateUserMetadataFailed
}
but the problem here is that when I try to create an account with a fake UUID, a successful metadata update happens even if no user with such id exists on supertokens. I am trying to through an error if the userid does not exists but it seems that no err is returned by above function all error handling is skipped.
here is the list of users registered in supertokens from frontend:aV
08/18/2022, 4:02 PMaV
08/18/2022, 4:03 PMaV
08/18/2022, 4:03 PMaV
08/18/2022, 4:04 PMaV
08/18/2022, 4:04 PMNicolasAlt
08/18/2022, 4:30 PMrp
08/18/2022, 4:31 PMdreamer
08/18/2022, 6:04 PMyzs
08/19/2022, 6:31 AMType '{ mode: string; }' is not assignable to type 'TypeInputEmailVerificationFeature'.
Object literal may only specify known properties, and 'mode' does not exist in type 'TypeInputEmailVerificationFeature'.ts(2322)
hi! is this normal?yiannis.gkoufas
08/19/2022, 9:34 AMThirdPartyEmailPassword.init({
signInAndUpFeature: {
providers: [Google.init()],
disableDefaultUI: false,
},
emailVerificationFeature: {
mode: "REQUIRED"
},
getRedirectionURL: async (context) => {
if (context.action === "SIGN_IN_AND_UP") {
return "/";
}
},
}),
i guess I have to create a new page and render the default component which is in /auth/verify-email?rid=thirdpartyemailpassword
?Vishnu
08/19/2022, 12:06 PMFinnTheHero
08/19/2022, 1:18 PMBinouse
08/19/2022, 2:04 PMError: Initialisation not done. Did you forget to call the SuperTokens.init function?
. However I call Supertokens.init in my api/auth/[[...path]].tsx do you know why ?gidgiddoni
08/19/2022, 11:33 PMgidgiddoni
08/19/2022, 11:33 PMrp
08/20/2022, 4:10 AMgidgiddoni
08/20/2022, 12:42 PMrp
08/20/2022, 12:43 PMgidgiddoni
08/20/2022, 12:50 PMrp
08/20/2022, 1:39 PM