Commit | Line | Data |
---|---|---|
d055ce0c | 1 | package RemoteTestApp1::Controller::Root; |
2 | use strict; | |
3 | use warnings; | |
4 | use base qw/Catalyst::Controller/; | |
5 | ||
6 | __PACKAGE__->config(namespace => ''); | |
7 | ||
8 | sub default : Local { | |
9 | my ( $self, $c ) = @_; | |
10 | if ($c->authenticate()) { | |
11 | $c->res->body('User:' . $c->user->{username}); | |
12 | } | |
13 | else { | |
14 | $c->res->body('FAIL'); | |
15 | $c->res->status(403); | |
16 | } | |
17 | } | |
18 | ||
19 | sub public : Local { | |
20 | my ( $self, $c ) = @_; | |
21 | $c->res->body('OK'); | |
22 | } | |
23 | ||
24 | 1; | |
25 |