package Authen::Pluggable::JSON;
$Authen::Pluggable::JSON::VERSION = '0.03';
use Mojo::Base -base, -signatures;
use Mojo::UserAgent;
use Mojo::URL;
has 'parent' => undef, weak => 1;
has _cfg => sub
shift)->query( user => shift, pass => shift );
},
res_builder => sub($json) {return %$json ? $json : undef },
};
};
sub authen ( $s, $user, $pass ) {
my $ub = $s->_cfg->{query
my $ua = Mojo::UserAgent->new;
my $res = $ua->get($url)->result;
return $rb->( $res->json ) if ( $res->is_success );
return undef;
}
sub cfg ( $s, %cfg ) {
if (%cfg) {
w