TTC
Theo's Typesafe Cultbatata
Fetching only once
so i have an authToken being stored in the local storage and i want to send it in a POST request each time the user opens the site to check if its still valid, but how do i make the POST request only fire once when the website first loads, that way i know if the user is authenticated or not and dont have to fetch it again while they are using the app. Im using next 13 with the app dir
P
peterkyle01•311d ago
useEffect with reg ex for holding every url path on your app in the array of dependencies,and clean it up after render
G
Grey•311d ago
use a HTTP only cookie to store authtokens, that way they're always sent as a cookie in your http requests, plus no js can access those cookies
other than that a simple
useEffect
can suffice21KMembers
View on DiscordWant results from more Discord servers?
More Postsimport mysql into planetscaleHas anyone imported a database from your local pc into planetscale? With regard to the hostname whatPromise.all is not working in transaction in drizzleCan anyone tell me why this transaction is not working in drizzle?
it does not throwing any error bshortest import path with eslint + tsconfig.json pathsIs there any way to configure eslint (I am using `eslint-plugin-import` + `eslint-import-resolver-tyGitHub workflow doesnt runI have this PR here which requires the CI to pass but it doesnt run. Do I miss something or have I sgetServerAuthSession returning null in productionI have absolutely no clue how that is happening because I've implemented the same solution in anotheNot able to get the jwt token through cookiesHii all I'm trying to send the jwt token through cookies like first image .. Now I 'm trying to fetcNext api routes stoped working since clerk installedI installed clerk in my app and auth is working as expected. My probles is that all my api routes stDisable batching multiple useQueryI'm using useQuery as below:
```
const CompanyPage: NextPage<{ asxCode: string }> = ({ asxCode }) =>