File: Root.pm

package info (click to toggle)
libcatalyst-authentication-credential-authen-simple-perl 0.09-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 228 kB
  • ctags: 26
  • sloc: perl: 305; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 524 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
package AuthTestApp4::Controller::Root;

use strict;
use warnings;

use parent 'Catalyst::Controller';

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

sub authed_ok : Local {
	my ( $self, $c ) = @_;

        my $authd = $c->authenticate( { "username" => $c->request->param('username'),
	                               "password" => $c->request->param('password') });

	if ($authd){
	    $c->response->body( "authed " . $c->user->get('name') );
	} else {
           $c->response->body( "not authed" );
	}

        $c->logout;
}

1;