Added admin test and logout function

This commit is contained in:
Tom Bloor 2017-04-08 13:38:54 +01:00
parent b10daa469a
commit a78de6ea8e
4 changed files with 106 additions and 0 deletions

View file

@ -49,6 +49,7 @@ sub startup {
my $r = $self->routes;
$r->any('/')->to('root#index');
$r->any('/logout')->to('root#auth_logout');
$r->get('/admin')->to('admin#index');
$r->post('/admin')->to('admin#login');
my $api = $r->under('/api' => sub {

View file

@ -6,4 +6,12 @@ sub index {
}
sub auth_logout {
my $c = shift;
$c->logout;
$c->redirect_to('/');
}
1;