Hello everyone,

I'm writing test application with OAuth2 using Mojolicious::Plugin::Oauth2 
<https://metacpan.org/pod/Mojolicious::Plugin::OAuth2> asynchronius request 
to API and I've got a strange error

[error] Can't locate object method "delay" via package 
> "Mojolicious::Controller" at oauth2 line 40.
>

Here is my code:

#!/usr/bin/env perl
use Mojolicious::Lite;
use Mojolicious::Plugin::OAuth2;
use IO::Socket::SSL;

plugin 'OAuth2', {
   facebook => {
       key => "xxx",
       secret => "xxx",
        }
};

get "/auth" => sub {
    my $self = shift;
    $self->delay(
      sub {
        my $delay = shift;
        $self->get_token(facebook => $delay->begin);
      },
      sub {
        my($delay, $token, $tx) = @_;
        return $self->render(text => $tx->res->error) unless $token;
        $self->session(token => $token);
        $self->render(text => $token);
      });
};


app->start;


What's wrong? Is delay() 
<http://mojolicio.us/perldoc/Mojolicious/Plugin/DefaultHelpers#delay> 
method already outdated?

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to