+ $data->add_data({real_pass => $pass}); # store - to allow generate_token to not need to relookup the pass
+
+
+ ### validate the pass
+ if ($meth = $self->{'verify_password'}) {
+ if (! $meth->($self, $pass, $data)) {
+ $data->error('Password failed verification') if ! $data->error;
+ }
+ } else{
+ if (! $self->verify_password($pass, $data)) {
+ $data->error('Password failed verification') if ! $data->error;
+ }
+ }
+ return $data if $data->error;
+
+
+ ### validate the payload
+ if ($meth = $self->{'verify_payload'}) {
+ if (! $meth->($self, $data->{'payload'}, $data)) {
+ $data->error('Payload failed custom verification') if ! $data->error;
+ }
+ } else {
+ if (! $self->verify_payload($data->{'payload'}, $data)) {
+ $data->error('Payload failed verification') if ! $data->error;
+ }
+ }
+
+ return $data;
+}