79727994

Date: 2025-08-07 01:59:40
Score: 2
Natty:
Report link

I am trying to do the same using server actions not route handler and getting this issue again and again

 тип Error: Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options
    at async secureApiCall (src\lib\actions.ts:34:6)
    at async getAllUsers (src\app\admin\users\actions.ts:24:9)
    at async UsersPage (src\app\admin\users\page.tsx:12:16)
  32 |       console.log("Updated session token: ", session);
  33 |
> 34 |       await session.save();
     |      ^
  35 |
  36 |       // Retry original request
  37 |       return await cb(session.token); {
  digest: '533765442'
}
Reasons:
  • Blacklisted phrase (1): I am trying to
  • Blacklisted phrase (1): trying to do the same
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Momin Hyat