loading...

re: Building Vue.js Client SPA Token-Based Authentication with Laravel Sanctum VIEW POST

FULL DISCUSSION
 

This is a great tutorial! But I have a tiny question. While setting CORs as I understand we made the api accessible from everywhere? I want my api to work only within my website, how to achieve that?

 

Great question!

To make the api accessible from your site only, you have to set

 'allowed_origins' => ['http://yoursitename.com']

Screenshot

Access-Control-Allow-Origin

code of conduct - report abuse