[Catalyst] Reaction Authentication

Guillermo Roditi groditi at gmail.com
Tue Jan 23 23:05:07 GMT 2007


Hey, any chance you could post the working code now that you fixed it.

There is no actual real working code for reaction out there, and it'd be
nice to look at some real code..

in other words, can I see your finished action and controller classes so i
can steal ideas and learn something?

I am working on a reaction app that I will post to public SVN as soon as it
actually runs and keep it public as i develop it so other people can get an
idea aswell

On 1/16/07, Jonas Alves <jonas.alves at gmail.com> wrote:
>
>
>
> On 16/01/07, Matt S Trout <dbix-class at trout.me.uk> wrote:
> >
> >
> > On 15 Jan 2007, at 18:56, Jonas Alves wrote:
> >
> > >
> > >
> > > On 15/01/07, Jonas Alves <jonas.alves at gmail.com> wrote: On
> > > 14/01/07, Ash Berlin < ash_cpan at firemirror.com> wrote:
> > > Jonas Alves wrote:
> > > > Hi all,
> > > > I was starting to put authentication in a Reaction application
> > > that i'm
> > > > developing when I saw that Reaction has this classes:
> > > >
> > > > Reaction::InterfaceModel::Action::DBIC::Role::CheckUniques;
> > > > Reaction::InterfaceModel::Action::DBIC::User::ChangePassword;
> > > > Reaction::InterfaceModel::Action::DBIC::User::ResetPassword;
> > > > Reaction::InterfaceModel::Action::DBIC::User::Role::SetPassword;
> > > > Reaction::InterfaceModel::Action::User::ChangePassword;
> > > > Reaction::InterfaceModel::Action::User::ResetPassword;
> > > > Reaction::InterfaceModel::Action::User::SetPassword;
> > > >
> > > > It appears that Reaction already has some facilities to do auth
> > > stuff.
> > > > How can I use this classes to help me?
> > > >
> > > > Thanks a lot,
> > > > --
> > > > Jonas
> > > >
> > >
> > > Not having used Reaction myself BUT I suspect that these are for
> > > updating existing profile info in the DB.
> > >
> > > Do the authentication the same way you would in a normal Catalyst app.
> >
> > >
> > > Ash
> > >
> > > Thanks Ash,
> > > I already have authentication the same way i would in a normal
> > > Catalyst app. But now I would like to use the Reaction TT widgets
> > > to create a custom form with validation for authentication and
> > > another one to register a user. I read the source but could not
> > > achieved it.
> > > Matt, can you help?
> > >
> > > Thanks a lot,
> > > --
> > > Jonas
> > >
> > >
> > > Hi again,
> > > I've now created an Action class do handle the login. Here is the
> > > code:
> > >
> > > package MyApp::Model::Action::AuthUser;
> > > use Reaction::Class;
> > > use Reaction::Types::DBIC;
> > > use Reaction::InterfaceModel::Action;
> > > use Reaction::InterfaceModel::Action::DBIC::Role::CheckUniques;
> > >
> >
> > > class AuthUser is 'Reaction::InterfaceModel::Action', which {
> > >   does 'Reaction::InterfaceModel::Action::DBIC::Role::CheckUniques';
> > >   has '+target_model' =3D> (isa =3D> 'DBIx::Class::ResultSet');
> >
> >    has 'username' =3D> (isa =3D> 'NonEmptySimpleStr', is =3D> 'rw',
> > set_or_lazy_fail('username'));
> >    has 'password' =3D> (isa =3D> 'StrongPassword',    is =3D> 'rw',
> > set_or_lazy_fail('password'));
> >
> > >
> > >   has _unique_constraint_results =3D> (
> > >     isa =3D> 'HashRef',
> > >     is =3D> 'rw',
> > >     required =3D> 1,
> > >     default =3D> sub { {} },
> > >     metaclass =3D> 'Moose::Meta::Attribute'
> > >   );
> > >
> > >   implements do_apply =3D> as {
> > >     my $self =3D shift;
> > >     my $args =3D $self->parameter_hashref;
> > >     warn '=3D=3D> ' .Dumper $args;
> > >     # do auth stuff here
> > >   };
> > > };
> > >
> > > 1;
> >
> > > But the form is rendered just with the "ok" and "close" buttons.
> > > The fields are not displayed.
> > > I put some debug in ActionForm.pm BUILD method and found that $self-
> > > >_has_field_map() is always false and $action->parameter_attributes
> > > () does not return anything.
> > > What am i doing wrong?
> > >
> >
> > You have to put the attributes within the class block or the
> > superclass hasn't been set yet, which means the attributes default to
> > the wrong meta-attribute class and aren't created as
> > ParameterAttribute objects. At which point, it doesn't work :)
> >
> >
> It makes sense.
> Thanks a lot Matt. :)
>
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070123/7cae2=
66b/attachment.htm


More information about the Catalyst mailing list