silverbux / laravel-angular-admin

Laravel + Angularjs + Bootstrap + AdminLTE binded by Gulp workflow Admin Dashboard Boilerplate / Starter.
http://silverbux.github.io/laravel-angular-admin/
MIT License
923 stars 414 forks source link

Using Gulp watch will result in JWT failure #62

Closed thomasmktong closed 8 years ago

thomasmktong commented 8 years ago

if we use php artisan serve the site will be hosted in localhost:8080 by default.

if we then use gulp watch the site will be browser-sync'ed to another port, e.g. localhost:3000, the change of host seems will result in JWT error for every put request

{"message":"Wrong number of segments","status_code":401}

Actions such as updating user profile, will fail, if we carry out the action in localhost:3000 but it is completely normal in localhost:8000. Login is okay in both 3000 and 8000.

Anyone having this issue? Please correct me if I am wrong. Thanks.

silverbux commented 8 years ago

i cant reproduce the error, i tried googling, and it always points me to google oauth, can you check if your google client id, google client and google redirect are correct.

also serve laravel using php artisan serve --host=0 command

silverbux commented 8 years ago

if issue still exists you could eliminate 3000 and go directly to 8000 its just browserSync doing proxy on localhost:8000, the only disadvantage you'll have is not having your browser refresh on every file change anyway.

also i'm thinking to remove browserSync it seems a little buggy on windows platform

thomasmktong commented 8 years ago

Hi @silverbux ,

Thanks for your help. I do use 8000 on windows these days and it works fine. I also tried to use mac to build your project today but I cannot go to 3000, it doesn't respond at all. 8000 and 3001 (the brower sync settings page) work fine. Have you experienced this issue? thanks.

screen shot 2016-08-31 at 12 06 18 pm

Thomas

silverbux commented 8 years ago

yeah i use mac too, i use php artisan serve --host=0 to serve laravel

thomasmktong commented 8 years ago

Oh thanks! Everything works great on mac now after adding --host=0