Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

gasparyanyur's avatar

This action is unauthorized

Hi all. I have a an appwhich recieve request from another app. So in my app there is no users and etc. There are only global data .So I have created FormRequest and get my request via curl. But every time I am getting "This action is unauthorized" error. How can I solve this problem!

0 likes
5 replies
tykus's avatar

Change the for request's authorize() method to return true

Sergiu17's avatar

Hi, I guess that in your form request there's a authorize method which has some logic, or maybe a middleware is applied. Take a look in that form request, and run php artisan route:list to see if that route has applied middlewares

gasparyanyur's avatar

@Sergiu17 I have run the command and get the result loo like this POST | api/user/withdraw | | App\Http\Controllers\MainController@withdraw | api

tykus's avatar

Never mentioned authentication. In your form request class:

public function authorize()
{   return true;

}

Please or to participate in this conversation.