callstack1
02/03/2023, 4:44 AM{"message":"try refresh token"}
But I never make it past this point, and I have to manually navigate back to our sign in UI to generate a new magic link. Any ideas what I might be doing wrong here?
Here's my frontend init, declared globally in our main js file:
supertokens.init({
appInfo: {
apiDomain: "https://staging.<my_url>",
apiBasePath: "/auth",
appName: "..."
},
recipeList: [
supertokensSession.init(),
supertokensPasswordless.init(),
],
});
And my backend init (minus custom smtp server recipe):
init(
app_info=InputAppInfo(
app_name="...",
api_domain="https://staging.<my_url>",
website_domain="https://staging.<my_url>",
api_base_path="/auth",
website_base_path="/auth"
),
supertokens_config=SupertokensConfig(
connection_uri="http://supertokens:3567",
api_key="<api_key>"
),
framework='flask',
recipe_list=[
dashboard.init(api_key="<api_key>"),
session.init(),
passwordless.init(
flow_type="MAGIC_LINK",
contact_config=ContactEmailOnlyConfig(),
email_delivery=
...
And finally my middleware initialization, if that helps:
Middleware(app)
CORS(
app=app,
origins=[
"https://staging.<my_url>"
],
supports_credentials=True,
allow_headers=["Content-Type"] + get_all_cors_headers(),
)
rp_st
02/03/2023, 5:41 AMsAccessToken
cookiecallstack1
02/03/2023, 5:50 AM:authority: staging.<my_url>
:method: GET
:path: /
:scheme: https
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9
cache-control: max-age=0
cookie: sIdRefreshToken=519fc581-fdc6-40a6-ad9e-3d5245375d30; sIRTFrontend=519fc581-fdc6-40a6-ad9e-3d5245375d30; sFrontToken=eyJhdGUiOjE2NzUzOTg5NzIzODMsInVpZCI6ImIyN2YxZTc0LWFhYjEtNDcyNS1iOTI0LTIwMDQ5ZTA2ZDAwZCIsInVwIjp7fX0=
sec-ch-ua: "Not_A Brand";v="99", "Google Chrome";v="109", "Chromium";v="109"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
sec-fetch-dest: document
sec-fetch-mode: navigate
sec-fetch-site: none
sec-fetch-user: ?1
upgrade-insecure-requests: 1
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
rp_st
02/03/2023, 5:51 AMrp_st
02/03/2023, 5:51 AMcallstack1
02/03/2023, 6:01 AMrp_st
02/03/2023, 6:52 AMrp_st
02/03/2023, 6:52 AMcallstack1
02/03/2023, 2:40 PMcallstack1
02/03/2023, 2:43 PMrp_st
02/03/2023, 2:46 PMcallstack1
02/03/2023, 2:58 PMcallstack1
02/03/2023, 2:59 PMjarth1388
02/03/2023, 5:10 PMjarth1388
02/03/2023, 5:15 PMrp_st
02/03/2023, 5:23 PMjarth1388
02/03/2023, 5:30 PMrp_st
02/03/2023, 5:32 PMjarth1388
02/03/2023, 5:42 PMcallstack1
02/03/2023, 5:56 PMcallstack1
02/07/2023, 8:52 PMgetSession()
as a workaround for the middleware not refreshing properly, apparently due to all of my JS being served with the template.
I was able to successfully trigger the refresh upon an instance of UnauthorisedError
, and now am trying to set up the /refresh-session?redirectBack=/
route. I only see instructions for ReactJS/Angular/Vue implementation, but my app is built using Flask and vanilla JS/jquery primarily - is this method still possible in this case?callstack1
02/07/2023, 8:54 PMsupertokensSession.attemptRefreshingSession()
jarth1388
02/08/2023, 5:44 PM/refresh-session
and /session/refresh
because I didn't keep reading the second half of that page 🤦♂️ . Once I got that working everything worked great!