t::Facebook::Oauth2;
use strict;
use warnings;
use LWP::UserAgent;
use URI;
use URI::Escape;
use JSON::MaybeXS;
use Carp;
our $VERSION = '0.12';
sub new {
my ($class,%options) = @_;
my $sel
y $response = $self->{browser}->get($getURL);
my $json = decode_json($response->content());
if (!$response->is_success || exists $json->{error}){
##got an error response from face
book. die and display error message
croak "'" . $json->{error}->{type}. "'" . " " .$json->{error}->{message};
}
elsif ($json->{access_token}) {
##everything is ok proccess resp