Skip to content

Instantly share code, notes, and snippets.

@somatonic somatonic/login.php
Created Jun 8, 2015

Embed
What would you like to do?
processwire login
/**
* Custom login
* ==============================================================================
*/
wire()->addHookBefore("ProcessLogin::execute", function($event){
if(wire("user")->isLoggedin() && wire("input")->get("login")) {
wire("session")->redirect("/");
}
});
try {
$loginForm = $modules->ProcessLogin->execute();
if(!$user->isLoggedin()) $sidebar .= $loginForm;
} catch(WireException $e){
$error = $e->getMessage();
$sidebar .= $error;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.