workoutintheabstract
01/30/2022, 4:02 PMharshit
01/31/2022, 1:14 PMrp
01/31/2022, 1:19 PMharshit
01/31/2022, 1:26 PMFernando
01/31/2022, 1:48 PMrp
01/31/2022, 1:51 PM/studies
, you are essentially doing machine to machine request. This is different from frontend (website) to machine request.
Frontend -> machine requires session management like how we have
Machine -> machine requires API key.
So when you make a call to /studies
, you can pass in a secret API key along with the userId (which you can get from session.getUserId()
)Fernando
01/31/2022, 1:57 PMrp
01/31/2022, 1:57 PMFernando
01/31/2022, 1:58 PMrp
01/31/2022, 1:58 PMrp
01/31/2022, 1:58 PMFernando
01/31/2022, 2:01 PMFernando
01/31/2022, 2:01 PMFernando
01/31/2022, 2:02 PMrp
01/31/2022, 2:03 PMverifySession
function and one via some API key method.
If that API is called from your react code, it will depend on the verifySession
function for auth. If it's called from getServerSideProps
, it will depend on the API key for auth.Fernando
01/31/2022, 2:18 PMrp
01/31/2022, 2:19 PMverify_session
so that getServerSideProps
can call it with an API keyFernando
01/31/2022, 2:21 PMrp
02/01/2022, 6:14 AMmiguelcobain
02/01/2022, 8:25 AMsome-prexif
where it should read some-prefix
.rp
02/01/2022, 9:03 AMrp
02/01/2022, 9:04 AMgadi
02/01/2022, 12:21 PMrp
02/01/2022, 12:22 PMgadi
02/01/2022, 12:24 PMrp
02/01/2022, 12:25 PMsessionScope
setting basically says that share the session across all sub domainsrp
02/01/2022, 12:25 PMgadi
02/01/2022, 12:29 PMrp
02/01/2022, 12:38 PMgadi
02/01/2022, 12:38 PM