]> ruin.nu Git - ndwebbie.git/blob - lib/Catalyst/Plugin/Authentication/Store/NDWeb.pm
351e838bd1bbeb5a43ed39c104c97e11bac4571e
[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
7 use NDWeb::Auth::User;
8
9 our $VERSION= "0.104";
10
11
12
13 sub setup {
14         my $c = shift;
15
16     $c->default_auth_store(
17         Catalyst::Plugin::Authentication::Store::NDWeb->new(
18         )
19     );
20
21     $c->NEXT::setup(@_);
22
23 }
24
25 sub new {
26         my ( $class ) = @_;
27
28         my $self = {
29         };
30
31         bless $self, $class;
32 }
33
34 sub from_session {
35         my ( $self, $c, $frozenuser ) = @_;
36
37         my $user = NDWeb::Auth::User->new();
38
39         return $user->from_session($frozenuser, $c);
40 }
41
42 sub for_session {
43         my ($self, $c, $user) = @_;
44         return $user->for_session($c);
45 }
46
47 sub find_user {
48         my ( $self, $authinfo, $c ) = @_;
49
50         my $user = NDWeb::Auth::User->new();;
51
52         return $user->load($authinfo, $c);
53 }
54
55 sub user_supports {
56         my $self = shift;
57         # this can work as a class method on the user class
58         NDWeb::User->supports( @_ );
59 }
60
61 __PACKAGE__;
62
63 __END__
64
65 =head1 AUTHOR
66
67 Michael Andreen (harv@ruin.nu)
68
69 =head1 LICENSE
70
71 GPL 2.0, or later.
72
73 =cut