Hi… I needed some help…
So basically I wanna implement custom auth…
So i have configured an integration to make api calls to my backend.
I authenticate & run ensurePlasmicAppUser() & then const { user: plasmicUser, token: plasmicUserToken } = result;
Then save token to cookies like >> res.setHeader(‘Set-Cookie’, token=${plasmicUserToken}; HttpOnly; Secure; SameSite=Strict;
);
But when i try to access the pages which require min role as normal user… They still say
You don’t have access to this page <<
do i have to do something with the plasmicUser or Token…
what to do so that my app recognises the user ?
fmota
November 13, 2023, 7:51pm
3
Is this true for codegen also?
Can i create components & exporting proops to plasmicrootprovider
fmota
November 14, 2023, 8:34pm
6
fmota
November 14, 2023, 8:34pm
7
Sorry I didn’t understood what you meant with:
Can i create components & exporting proops to plasmicrootprovider
Basically i want to create components… & Use props to pass custom variables… Because lets say i wrote a custom code inside the wrapper of a component…now how don i make the component interact with that custom code … How do i pass the pros in plasmic studio
Hello…
I have one more question… When we call ensureplasmicuser function & it returns user & token… & then if we pass it to PlasmicRootProvider like >>
Does it handle saving plasmicUser & plasmicUserToken to the cookies & recovering it when accessed by the user ?
fmota
November 16, 2023, 11:26pm
10
If you are using custom auth, you would have to handle saving/recovering plasmicUser/plasmicUserToken, the won’t do that for you