]> ruin.nu Git - ndwebbie.git/blob - lib/Catalyst/Plugin/Authentication/Store/NDWeb.pm
Merge updates from new catalyst.pl
[ndwebbie.git] / lib / Catalyst / Plugin / Authentication / Store / NDWeb.pm
1 package Catalyst::Plugin::Authentication::Store::NDWeb;
2
3 use strict;
4 use warnings;
5 use Moose;
6 use MRO::Compat;
7
8 use NDWeb::Auth::User;
9
10 our $VERSION= "0.104";
11
12
13
14 sub setup {
15         my $c = shift;
16
17         $c->default_auth_store(
18                 Catalyst::Plugin::Authentication::Store::NDWeb->new(
19                 )
20         );
21
22         $c->next::method(@_);
23
24 }
25
26 sub from_session {
27         my ( $self, $c, $frozenuser ) = @_;
28
29         my $user = NDWeb::Auth::User->new();
30
31         return $user->from_session($frozenuser, $c);
32 }
33
34 sub for_session {
35         my ($self, $c, $user) = @_;
36         return $user->for_session($c);
37 }
38
39 sub find_user {
40         my ( $self, $authinfo, $c ) = @_;
41
42         my $user = NDWeb::Auth::User->new();;
43
44         return $user->load($authinfo, $c);
45 }
46
47 sub user_supports {
48         my $self = shift;
49         # this can work as a class method on the user class
50         NDWeb::User->supports( @_ );
51 }
52
53 __PACKAGE__->meta->make_immutable;
54
55 __END__
56
57 =head1 AUTHOR
58
59 Michael Andreen (harv@ruin.nu)
60
61 =head1 LICENSE
62
63 GPL 2.0, or later.
64
65 =cut