RSION = '0.0601';
use strictures 2;
use Carp qw(croak);
use Mojo::UserAgent ();
use Mojo::JSON qw(decode_json);
use Mojo::URL ();
use Moo;
use Try::Tiny;
use namespace::clean;
has username => (
t(
$self->base . 'users/auth',
{ 'Content-Type' => 'application/json' },
json => { username => $args->{username}, password => $args->{password} },
);
if ( $res->is_success ) {
my $body = $res->body;
try {
$data = decode_json($body);
}
catch {
croak $body, "\n";
};
}
else {