m615's avatar
Level 2

Can I authenticate with Sanctum using another Laravel backend instead of a SPA?

I have two laravel applications. One is going to be an Admin application that will control all the content for several subdomain apps that I'm creating with another Laravel app that will basically be an e-commerce application.

I'm using Laravel 8 and I've implemented Sanctum because it's part of the Laravel Jestream Auth system.

My Laravel Ecommerce application will be making REST calls to my CMS to get product data and eventually to submit orders from customers.

I'd like to be able to register and login users via the API and keep all the users in the same CMS / Admin tool that I'm building.

How should I go about doing this? I need recommendations on how to log in from a Laravel Controller and then store the CRF Token in a browser cookie so I can manage the user login and logout.

Basically, once the user is logged in to one subdomain I'd like for them to be logged into all subdomains.

0 likes
0 replies

Please or to participate in this conversation.