Closed Filip785 closed 3 years ago
Hi there,
Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels:
However, this issue will not be locked and everyone is still free to discuss solutions to your problem!
Thanks.
Description:
I'm trying to use Fortify as an API authentication for my React app, but attempting to use the
/register
route more then once throws theNotFoundHttpException
. Basically, the first time I use the/register
route (passing correct JSON to register the user) it will work, validate & add the data to the database, the next time I try it will throw anNotFoundHttpException
. I tried to clear routes cache, app cache etc but it didn't help at all. Same issue happens again. If I remove the project and recreate it, same thing happens.The weird part in all of this is if I try to make GET request to this API route it will tell me that this action is not supported (meaning that it exists but cannot do GET on it), but the POST request will give me
NotFoundHttpException
(meaning it doesn't exist at all?). I also ranphp artisan route:list
and the/register
route is showing with correct method - POST.Am I missing something?
Steps To Reproduce:
composer require laravel/fortify
php artisan vendor:publish --provider="Laravel\Fortify\FortifyServiceProvider"
php artisan migrate
'views' => false
infortify.php
(since I'm using Fortify as API only)FortifyServiceProvider
to app.phpproviders
array/register
route through API client such as Insomnia or PostmanNotFoundHttpException
EDIT: I figured out that this happens because as soon as registration is done, I get "logged in" as well, thus it returns this exception. If I make a POST to /logout and try to register again it works as expected.