rp
12/18/2021, 5:43 PMrp
12/18/2021, 5:43 PMkakashi_44
12/19/2021, 1:54 PMtelemetry=False
in init config and check if you are still getting the above error. If you are still encountering the same error, the library will need to be updated for the scenario where Fastapi is used along with an wsgi server. Currently we only support that for djangoJim Gambit
12/20/2021, 6:54 AMJim Gambit
12/20/2021, 6:57 AMrp
12/20/2021, 6:58 AMJim Gambit
12/20/2021, 6:58 AMrp
12/20/2021, 7:24 AMJim Gambit
12/20/2021, 9:21 AMJim Gambit
12/20/2021, 9:21 AMJim Gambit
12/21/2021, 6:40 AMrp
12/21/2021, 6:42 AMrelentless
12/23/2021, 3:10 AMrp
12/23/2021, 4:52 AMrelentless
12/23/2021, 5:08 AMrp
12/23/2021, 5:55 AMgetSession
throws a TRY_REFRESH_TOKEN
error, then you need to send a 401 to the frontend. This can happen if a session exists, but the access token has expired. So your code should change to like:
try {
const existingSession = await Session.getSession(...)
...
return {
id: data.id,
...
}
} catch {
if (err.type === Session.Error.TRY_REFRESH_TOKEN) {
// return 401 to frontend
} else {
return InternalServerError(error);
}
}
relentless
12/23/2021, 11:07 AMrp
12/23/2021, 11:15 AMgetSession
will throw this error. You should then send a 401 to the frontend which will then (via our SDK) try and call the refresh API automatically.
Once a refresh is successful, the new access token is sent back to this API and this time, getSession
should succeed.Vetro
12/23/2021, 1:38 PMPOST
to /{apiBasePath}/session/refresh
) i'm always getting a 401... how should I do it corrctly?
I'm sending all required params at query params, and it dont want to workrp
12/23/2021, 1:43 PMrp
12/23/2021, 1:43 PMVetro
12/23/2021, 1:45 PM401 unauthorized
rp
12/23/2021, 1:45 PMcurl 'https://localhost:3000/auth/session/refresh' \
-X 'POST' \
-H 'rid: session' \
-H 'Cookie: sRefreshToken=ATa8vaSYm3PvteMeAnAuAE3a8tV0WlQDArCkhVmnkVIPthrHsdDpymIEssv%2BKXn5OSABMc%2Fw5zofn9Q%2BjKEs53rSf5A%2Bobxr7%2BBqTR9qOQO%2Bu8f7IozxMuY1KfwDiMKYOZRYjOW7BT5RE9E1kuOvcigqog5hNvyp1mYqF9VgO4Oho1mhX0s%2BjL5RV7ZdLN3RKqVrZQVm35Cy%2FqUvG7e7zhtMYX5AMSecA8OnZ7X%2By4VVnf7opkmy4L5UiWgmvUuVGZJ0OJwYRSCYpKyzYhso1LVFiTA6hXeStghiXaDMsNtgnXqktbk8JXnD4npOe3dVm3hlBZvOd0ol7beCoNvDaKFEgCEemZjBCL8BdsMtQ%2BYL2OOsiySBua57gumIhXIOp2AKb7tBIo15vqgB.02eddfb35c1e47b62defad9fd2a0517ece5b8e744df214916eb534cf289e0306.V2; sIdRefreshToken=0db5d679-7a7f-4d06-9cec-f3778aa0b2f7'
rp
12/23/2021, 1:47 PMrp
12/23/2021, 1:47 PMVetro
12/23/2021, 1:47 PMVetro
12/23/2021, 1:48 PMrp
12/23/2021, 1:48 PMrp
12/23/2021, 1:48 PMrp
12/23/2021, 1:49 PM