package Pear::LocalLoop::Controller::Root;
use Mojo::Base 'Mojolicious::Controller';
sub index {
my $c = shift;
# if ( $c->is_user_authenticated ) {
# $c->redirect_to('/home');
# }
}
sub under {
if ( $c->is_user_authenticated ) {
return 1;
$c->redirect_to('/');
return;
sub auth_login {
if ( $c->authenticate($c->param('email'), $c->param('password')) ) {
$c->redirect_to('/home');
} else {
sub auth_logout {
$c->logout;
sub home {
1;