skn-036 / cms-role-permission-laravel-vue-spa

This repository uses PHP Laravel and Javascript Vue.js frameworks to implement Role Permissions management in CMS. Cookie based SPA authorization feature of Laravel Sanctum package is used to authorize the user inside the content management system. If a logged user has permission to do specific task, the link to visit the task and the page containing the task will be available to the logged user. Otherwise the page will be unavailable to the logged user with 401 unauthorized error even though try to access the route manually. This repo utilizes the SPA feature of Vue.js.
27 stars 15 forks source link

logged out after refresh page when change App_URL #23

Closed shinnlu closed 9 months ago

shinnlu commented 9 months ago

Hi, i found it's not possible to change APP_URL, after change it will Redirected to login after refreshing any protected page.

php artisan serve with original .env

apache server & change .env

skn-036 commented 9 months ago

Hi shinnlu I have made a minor change. Please check after pulling. If the error persists, I need more information about the error. Like any error on the console or any error on the network request to debug the issue properly.

Thanks

shinnlu commented 9 months ago

i may found the problem. i need to run php artisan optimize:clear to clear the session cache after change APP_URL and SANCTUM_STATEFUL_DOMAINS, or the session will keep logged out when refresh.

thank you for your project, it is a good start to learn role based project with vue.

skn-036 commented 9 months ago

Hi Thanks. I have tried to made it in such a way, it will easily scale up to any project. Hope it helps !!!