I have different routes on my applications:
GET /game/{any}
This route is protected by Laravel auth middleware. Inside this Laravel route I want to build SPA and provide Vue router:
const routes = [
{ path: '/game/start', component: GameStart },
{ path: '/game/stats', component: GameStats }
]
And I have 'main' route which is not protected by any Laravel Middleware
GET /{any}
Whole Vue Router looks like this:
const routes = [
// Not protected URLs
{ path: '/', component: Main },
{ path: '/news', component: News },
// Protected URLs
{ path: '/game/start', component: GameStart },
{ path: '/game/stats', component: GameStats }
]
So my question is: Is it good idea to mixed up back-end and front-end like this? Because I'm assuming that '/game/*' routers is not protected on front-end part.
Or should I use Laravel Passport and token auth on frond-end?