1 package Reaction::UI::ViewPort::Field::Mutable::MatchingPasswords;
4 use aliased 'Reaction::UI::ViewPort::Field::Mutable::Password';
6 class MatchingPasswords is Password, which {
8 has check_value => (is => 'rw', isa => 'Str', );
10 #maybe both check_value and value_string should have triggers ?
11 #that way if one even happens before the other it would still work?
12 around _adopt_value_string => sub {
15 return $orig->(@_) if $self->check_value eq $self->value_string;
16 $self->message("Passwords do not match");
19 #order is important check_value should happen before value here ...
20 #i don't like how this works, it's unnecessarily fragile, but how else ?
21 around accept_events => sub { ('check_value', shift->(@_)) };
23 around can_sync_to_action => sub {
26 return $orig->(@_) if $self->check_value eq $self->value_string;
27 $self->message("Passwords do not match");