Jump to content

[SOLVED] Pointing PW login to my own login page


matsn0w
 Share

Recommended Posts

Hey all,

I am working on a website and I want to style the login page, but I'm a bit confused. 

I want either the existing login page styled in my own way using some CSS (I guess I prefer that) or I want to create a custom page with a form to login. (Which I could style too).

I used the code from Ryan and Renobird posted here - which works great - but that doesn't replace the original login page. 

Is there a way to some sort of 'disable' the original login?

I hope my question is clear and thanks in advance,

matsn0w

Edited by matsn0w
solved
Link to comment
Share on other sites

Is this custom login page for front-end users or for users who need to access the PW back-end?

If it's for front-end users then I think you don't want them knowing about the core login page at all. You get a bit of extra security if you use a login page name that is not easily guessable (e.g. not "admin" or "processwire") and do not provide links to the core login page from the front-end. Then you only reveal the core login page to users who need to access the back-end.

If the login page is for back-end users then I'm not sure why you would not want to use the admin-styled form given that the user is about to be working in the rest of the admin, but you could redirect away from it to your custom login page with a hook in /site/ready.php

$wire->addHookBefore('ProcessLogin::execute', function(HookEvent $event) {
    $this->session->redirect('/your-login-page/');
});

 

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...