Did test and routing fixes and dependency fix

This commit is contained in:
piratefinn 2017-04-24 17:42:07 +01:00
parent 2acee95d86
commit a4ce60407e
12 changed files with 116 additions and 116 deletions

View file

@ -6,10 +6,8 @@ sub under {
if ( $c->is_user_authenticated ) {
return 1 if defined $c->current_user->administrator;
$c->redirect_to('/home');
} else {
$c->redirect_to('/');
}
$c->redirect_to('/');
return undef;
}
@ -31,4 +29,21 @@ sub home {
);
}
sub auth_login {
my $c = shift;
if ( $c->authenticate($c->param('email'), $c->param('password')) ) {
$c->redirect_to('/admin/home');
} else {
$c->redirect_to('/admin');
}
}
sub auth_logout {
my $c = shift;
$c->logout;
$c->redirect_to('/admin');
}
1;

View file

@ -4,9 +4,9 @@ use Mojo::Base 'Mojolicious::Controller';
sub index {
my $c = shift;
if ( $c->is_user_authenticated ) {
$c->redirect_to('/home');
}
# if ( $c->is_user_authenticated ) {
# $c->redirect_to('/home');
# }
}
sub under {