File: AuthSessionTestApp.pm

package info (click to toggle)
libcatalyst-plugin-authentication-perl 0.10024-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 508 kB
  • sloc: perl: 1,531; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 690 bytes parent folder | download
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
29
30
31
32
33
34
35
36
37
package User::SessionRestoring;
use base qw/Catalyst::Authentication::User::Hash/;

sub for_session { $_[0]->id }
sub store { $_[0]->{store} }

package AuthSessionTestApp;
use strict;
use warnings;
use base qw/Catalyst/;

use Catalyst qw/
    Session
    Session::Store::Dummy
    Session::State::Cookie

    Authentication
    Authentication::Store::Minimal
    Authentication::Credential::Password
/;

our $users = {
    foo => User::SessionRestoring->new(
        id => 'foo',
        password => "s3cr3t",
    ),
};

__PACKAGE__->config(authentication => {users => $users});

__PACKAGE__->setup;
__PACKAGE__->log->levels();

$users->{foo}{store} = __PACKAGE__->default_auth_store;

1;