File: Root.pm

package info (click to toggle)
libcatalyst-plugin-authentication-perl 0.10023-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 604 kB
  • ctags: 307
  • sloc: perl: 3,672; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 492 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package RemoteTestApp2::Controller::Root;
use strict;
use warnings;
use base 'Catalyst::Controller';

__PACKAGE__->config(namespace => '');

sub default : Local {
    my ( $self, $c ) = @_;
    if ($c->authenticate()) {
        $c->res->body(
              'my_user_name:'
              . $c->user->{my_user_name}
        );
    }
    else {
        $c->res->body('FAIL');
        $c->res->status(403);
    }
}

sub public : Local {
    my ( $self, $c ) = @_;
    $c->res->body('OK');
}

1;