use Class::Inspector;
use Catalyst::Authentication::Realm;
-# this optimization breaks under Template::Toolkit
-# use user_exists instead
-#BEGIN {
-# require constant;
-# constant->import(have_want => eval { require Want });
-#}
-## NOTE TO SELF:
-## move user persistence into realm.
-## basically I'll provide 'persist_user' which will save the currently auth'd user.
-## 'restore_user' which will restore the user, and 'user_is_restorable' which is a
-## true/false on whether there is a user to restore.
-
-our $VERSION = "0.11000";
+our $VERSION = "0.10007_01";
sub set_authenticated {
my ( $c, $user, $realmname ) = @_;
my $realmcfg = {
store => { class => $cfg->{'stores'}{$storename} },
};
+ print STDERR "Foo, ok?\n";
$app->setup_auth_realm($storename, $realmcfg);
}
}
},
store => {
class => 'Minimal',
- users = {
+ users => {
bob => {
password => "s00p3r",
editor => 'yes',
sub login : Local {
my ( $self, $c ) = @_;
- if ( my $user = $c->req->param("user")
- and my $password = $c->req->param("password") )
+ if ( my $user = $c->req->params->{user}
+ and my $password = $c->req->params->{password"} )
{
if ( $c->authenticate( { username => $user,
password => $password } ) ) {
sub edit : Local {
my ( $self, $c ) = @_;
- $c->detach("unauthorized") unless $c->check_roles("edit");
+ $c->detach("unauthorized") unless $c->check_user_roles("edit");
# do something restricted here
}
Retrieves the realm instance for the realmname provided.
+=head2 $c->update_user_in_session
+
+This was a short lived method to update user information - you should use persist_user instead.
+
=head1 SEE ALSO
This list might not be up to date. Below are modules known to work with the updated
At the time of writing these plugins have not yet been replaced or updated, but
should be eventually: L<Catalyst::Plugin::Authentication::OpenID>,
-L<Catalyst::Plugin::Authentication::LDAP>,
L<Catalyst::Plugin::Authentication::CDBI::Basic>,
L<Catalyst::Plugin::Authentication::Basic::Remote>.