File: AuthSessionTestApp.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 (36 lines) | stat: -rw-r--r-- 662 bytes parent folder | download | duplicates (3)
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
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;

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

1;