1 package Reaction::InterfaceModel::Action::User::Login;
4 use aliased 'Reaction::InterfaceModel::Action';
6 class Login, is Action, which {
8 has 'username' => (isa => 'SimpleStr', is => 'rw', lazy_fail => 1);
9 has 'password' => (isa => 'Password', is => 'rw', lazy_fail => 1);
11 around error_for_attribute => sub {
13 my ($self, $attr) = @_;
14 my $result = $super->(@_);
15 my $predicate = $attr->predicate;
16 if (defined $result && $self->$predicate) {
17 return 'Invalid username or password';
22 implements do_apply => as {
24 my $target = $self->target_model;
25 return $target->login($self->username, $self->password);
33 Reaction::InterfaceModel::Action::User::Login
43 See L<Reaction::Class> for authors.
47 See L<Reaction::Class> for the license.