I'm trying to host a Laravel API (Sever) project on Heruko along with Vue js project separately, 2 individual project. Is it possible to use laravel airlock/sanctum to authenticate user on the heruko free given domain?
Asked
Active
Viewed 168 times
0
-
This question is hard to answer, as there are a lot of important details missing. There is nothing inherently that should prevent `sanctum` from working but it is best to try first. Then and only then if you run into any problems create a new question with all **relevant** content. Providing a [mcve] will increase your chances of getting good answers. – Dan Mason Apr 11 '20 at 19:31
-
In airlock there are two modes - by api key or by cookie. What are You using? With API key You can host server and frontend in any place, just this about CORS settings in backend. With cookies, well.. you have to make sure that cookies will work ;) So bots apps should be on same host but different port, or subdomain and main domain but with host specified in cookie - etc. It all depends what options do You have on free tier with heroku and what Your connection between backend and frontend looks like. – chojnicki Apr 11 '20 at 19:39
-
Am using the cookie SPA Authentication. My vue client project is hosting on vue-example.heroku.com and my laravel server project is hosting on laravel-example.heroku.com. I use Axios to connect to the frontend to the backend api routes. And it working fine while in development. But moving to to Production is the problem idk how to config the environment variables AIRLOCK_STATEFUL_DOMANIS, SESSION _DRIVER for the cookie to be placed on the client – Parchie Apr 12 '20 at 23:01