DEV Community

Discussion on: Building Vue.js Client SPA Token-Based Authentication with Laravel Sanctum

emrecanful profile image
Emre Can Çakıroğlu • Edited on

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?

romanpaprotsky profile image
Roman Paprotsky Author • Edited on

Great question!

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

 'allowed_origins' => ['']