File: Root.pm

package info (click to toggle)
libcatalyst-plugin-authentication-perl 0.10023-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 608 kB
  • sloc: perl: 3,672; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 444 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
package RemoteTestApp1::Controller::Root;
use strict;
use warnings;
use base qw/Catalyst::Controller/;

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

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

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

1;