how to generate public token and handle errors. #74330
Replies: 3 comments 2 replies
-
store any tokens on client-side is bad practice. Are you sure you dont have any other solutions? |
Beta Was this translation helpful? Give feedback.
-
You can use cookies, on the server, you can access it as described here |
Beta Was this translation helpful? Give feedback.
-
The key is to generate the token server-side, store it securely in a cookie, and create a reusable method for attaching it to requests. This approach prevents token generation issues in server components and provides a clean, consistent way to handle public token authentication. |
Beta Was this translation helpful? Give feedback.
-
Hello, my app needs to have a public token saved in a cookie for subsequent use. It also needs to attach this public token to client-side queries and handle API request errors. How can I implement this?
Beta Was this translation helpful? Give feedback.
All reactions