You may be familiar of the server actions in nextj...
# support-questions-legacy
y
You may be familiar of the server actions in nextjs. How do I protect the server actions for authorized usage ? We can protect the api with "withSession" helper function but as we dont have any request in server actions so I can use that func.
r
hey @youscript you can use this function: https://github.com/supertokens/next.js/blob/canary/examples/with-supertokens/app/sessionUtils.ts#L11. If you see, it takes an optional request object. So you can just call it like
await getSSRSession()
y
Oh Okh Thanks
9 Views