NAME

Articulate::Credentials - represent an authentication request/response

FUNCTIONS

new_credentials

my $credentials = new_credentials $user_id, $password;
my $credentials = new_credentials { email => $email, api_key => $key };

Creates a new request, using the user_id and password supplied as the respective arguments; or other fields if they are supplied instead.

METHODS

new

An unremarkable Moo constructor.

accept

$credentials->accept('Password matched');

Declares that the credentials are valid, for the reason given; sets accpeted and rejected and populates the stack trace.

reject

$credentials->reject('User not found');

Declares that the credentials are invalid, for the reason given; sets accpeted and rejected and populates the stack trace.

ATTRIBUTES

fields

The credentials provided, typically user_id and password.

accepted

Whether or not the credentials have been explicitly accepted. The value of this is used for overload behaviour.

Please do not explicitly set this. Use accept instead.

rejected

Whether the credentials have been explicitly rejected.

Please do not explicitly set this. Use reject instead.

reason

The reason for the acceptance or rejection of credentials.

Please do not explicitly set this. Use accept or reject instead.

stack_trace

The stack trace at the point of acceptance or rejection of credentials.

Please do not explicitly set this. Use accept or reject instead.

SEE ALSO