You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm implementing OAuth in a pretty large code-base, i've passed the OAuth2 object down from the controller into a service layer object, which ultimately should be making the call too get_token_p however, the parameter passed to the ->then(...) callback seems to ALWAYS be undef, and at the speed of the error I'm almost 100% sure it doesn't make a call at all. I haven't had this issue with seemingly identical code that lives in the Mojolicious::Controller,
Custom service level code
subexecute {
my$self = shift;
my$args = {
scope=>$self->scope, # 'user email'redirect_uri=>$self->redirect_uri # 'http://localhost:3000/login/github'
};
return$self->oauth->get_token_p( github=>$args )->then(
sub {
my$pr = shift;
use DDP;
p $pr;
p $self->oauth->providers;
return$pr->{access_token};
});
}
The text was updated successfully, but these errors were encountered:
rawleyfowler
changed the title
get_token_p seems to always return undef on callbackget_token_p seems to always return undef on callback when not called from controller
Nov 20, 2023
I'm implementing OAuth in a pretty large code-base, i've passed the
OAuth2
object down from the controller into a service layer object, which ultimately should be making the call tooget_token_p
however, the parameter passed to the->then(...)
callback seems to ALWAYS beundef
, and at the speed of the error I'm almost 100% sure it doesn't make a call at all. I haven't had this issue with seemingly identical code that lives in theMojolicious::Controller
,Custom service level code
First print:
Second print (redacted of course):
Controller code
The text was updated successfully, but these errors were encountered: