callstack1
01/26/2023, 1:56 AMSupertokensConfig
..
2. Does SuperTokens need to be initialized twice for Flask apps? I.e., once in a JS script for front end and again in the main app.py
file? Or just once in app.py
?rp_st
01/26/2023, 5:39 AMrp_st
01/26/2023, 5:40 AMrp_st
01/26/2023, 5:40 AMcallstack1
01/26/2023, 3:45 PMconnection_uri
needs to be the uri established when setting up the Postgre docker container?
Which leads to my next question - our app uses Postgre when running on our production server, but local test environments use SQLite. Is it possible to use a SQLite db as the supertokens core instance for local testing purposes?
I tried making a new db using the schema listed in the docs and passing it to connection_uri, but got SERVER ERROR: Failed to load user list. Please refresh to try again.
after I entered the API key on <my_url>/auth/dashboard
rp_st
01/26/2023, 3:46 PMrp_st
01/26/2023, 3:46 PMrp_st
01/26/2023, 3:47 PMcallstack1
01/26/2023, 5:38 PMtokens.<oururl>
, then this should be the value of connection uri?
I changed to this url, but now am getting this error when loading the dashboard:callstack1
01/26/2023, 5:41 PMtokens.<oururl>.com
, but our dev workflow requires the app to be run locally for testing purposes.. Could this be the source of the issue, or is this likely due to incorrect setup somewhere?callstack1
01/26/2023, 8:17 PM<script>
supertokens.init({
appInfo: {
apiDomain: "https://staging.<my_url>.com",
apiBasePath: "/auth",
appName: "..."
},
recipeList: [
supertokensSession.init(),
supertokensPasswordless.init(),
],
});
</script>
And my backend init:
init(
app_info=InputAppInfo(
app_name="...",
api_domain="https://staging.<my_url>.com",
website_domain="https://staging.<my_url>.com",
api_base_path="/auth",
website_base_path="/auth"
),
supertokens_config=SupertokensConfig(
connection_uri="https://tokens.<my_url>.com",
api_key="<MY API KEY>"
),
framework='flask',
recipe_list=[
dashboard.init(api_key="<MY API KEY>"),
session.init(),
passwordless.init(
flow_type="MAGIC_LINK",
contact_config=ContactEmailOnlyConfig()
)
]
)
Middleware(app)
CORS(
app=app,
origins=[
"https://staging.<my_url>.com"
],
supports_credentials=True,
allow_headers=["Content-Type"] + get_all_cors_headers(),
)
https://tokens.<my_url>.com
is the hosted url that should be connected to our supertokens postgres (which seems to be up and running)rp_st
01/27/2023, 5:43 AMhttps://tokens.<my_url>.com
, on the browser, do you get a "Hello" message back?callstack1
01/27/2023, 2:50 PMrp_st
01/27/2023, 3:53 PMrp_st
01/27/2023, 3:53 PMrp_st
01/27/2023, 3:53 PMcallstack1
01/27/2023, 3:57 PMrp_st
01/27/2023, 3:59 PMcallstack1
01/27/2023, 4:27 PMconnection_uri
to http://supertokens:3567
and now am getting this screen when I visit \auth\dashboard
rp_st
01/27/2023, 6:25 PMcallstack1
01/27/2023, 7:21 PMSuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).
Powered by