« lib/Reaction/UI/ViewPort/Collection/Grid/Member.pm
↑ Summary
lib/Reaction/UI/Controller/Role/Action/Delete.pm »
| 1 | package Reaction::InterfaceModel::Action::User::Login; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use Reaction::Class; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use aliased 'Reaction::InterfaceModel::Action'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Reaction::Types::Core qw(SimpleStr Password); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use namespace::clean -except => [ qw(meta) ]; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 1 | extends Action; | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | # Avoid circular ref with target_model for Auth controller login actions. | ||||||||||||||||||||||||||||
| 11 | 0 | ▶ | sub BUILD { Scalar::Util::weaken($_[0]->{target_model}) } | ||||||||||||||||||||||||||
|
Subroutine
BUILD: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 1 | has 'username' => (isa => SimpleStr, is => 'rw', lazy_fail => 1); | |||||||||||||||||||||||||||
| 14 | 1 | has 'password' => (isa => Password, is => 'rw', lazy_fail => 1); | |||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 0 | ▶ | around error_for_attribute => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 17 | 0 | my $super = shift; | |||||||||||||||||||||||||||
| 18 | 0 | my ($self, $attr) = @_; | |||||||||||||||||||||||||||
| 19 | 0 | my $result = $super->(@_); | |||||||||||||||||||||||||||
| 20 | 0 | my $predicate = $attr->get_predicate_method; | |||||||||||||||||||||||||||
| 21 | 0 | ▶ | if (defined $result && $self->$predicate) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $result and $self->$predicate
MC/DC0%0/2
defined $result and $self->$predicate
defined $result
$self->$predicate
Truth table0%0/3
A and B
A= defined $resultB= $self->$predicate
| |||||||||||||||||||||||||||||
| 22 | 0 | return 'Invalid username or password'; | |||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||
| 24 | 0 | return; | |||||||||||||||||||||||||||
| 25 | 1 | }; | |||||||||||||||||||||||||||
| 26 | 0 | ▶ | sub do_apply { | ||||||||||||||||||||||||||
|
Subroutine
do_apply: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 27 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 28 | 0 | my $target = $self->target_model; | |||||||||||||||||||||||||||
| 29 | 0 | return $target->login($self->username, $self->password); | |||||||||||||||||||||||||||
| 30 | }; | ||||||||||||||||||||||||||||
| 31 | 1 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 1 | 1; | |||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | =head1 NAME | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | Reaction::InterfaceModel::Action::User::Login | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | =head2 username | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | =head2 password | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | =head1 AUTHORS | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | See L<Reaction::Class> for authors. | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | =head1 LICENSE | ||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | See L<Reaction::Class> for the license. | ||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | =cut | ||||||||||||||||||||||||||||