Web-Feet / coasterframework

Main code repository for Coaster CMS (coastercms.org), a full featured Laravel based, Content Management System
https://www.coastercms.org
GNU General Public License v3.0
31 stars 22 forks source link

protect front end too with admin auth #71

Closed amirgee007 closed 6 years ago

amirgee007 commented 6 years ago

hi, i am using this CMS but I need one information here. just want to protect front-end website with the same username and password of admin.

in other words, just need to add all the routes in the admin auth middleware.how can i do this?

because i don't want to see anyone my website so that whenever anyone tried to access my website so that he needs to first login in admin then he can proceed.

chadanuk commented 6 years ago

@amirgee007 I would add some middleware to the app folder, 'web' group that checks if the auth user is admin.

amirgee007 commented 6 years ago

yes i added $this->middleware('coaster.admin'); in the CMSController and remov check from AdminAuth and it works fine for me...

thanks a lot @chadanuk

chadanuk commented 6 years ago

Hi @amirgee007,

I'm glad that you've worked out a way to get this into your build.

However, I would just warn that if we release an update and you've updated the core then your changes will be lost. Ideally, this would be done in the app folder, either in an extended CmsController or in Http/Kernel.php

😄

amirgee007 commented 6 years ago

ohh thats the problem i just disable the updates on my side.

but what will be best to do for this?

there is no publish command in the cms like other so how can we update anything out of the vendor folder.

chadanuk commented 6 years ago

It should be possible to create your own middleware in the 'web' group https://laravel.com/docs/5.5/middleware?