rp
08/16/2022, 4:42 AMpiano1029
08/16/2022, 11:38 AMLuxaaa
08/16/2022, 11:51 AMsupertokens_python.exceptions.GeneralError: No SuperTokens core available to query
on my server. Is there any reason why this happens?rp
08/16/2022, 12:05 PMRoy R
08/16/2022, 12:51 PMrp
08/16/2022, 1:06 PMLuxaaa
08/16/2022, 2:54 PMIaS1506
08/16/2022, 4:16 PMKillian
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: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 PM