Answer the question
In order to leave comments, you need to log in
Yii2: how to make authorization through social networks without a redirect, but by calling a javascript callback function?
I raise a question to which there is no answer:
stackoverflow.com/questions/36512143/yii2-authacti...
It is necessary to make authorization through social networks without a redirect, but by calling the javascript callback function, passing parameters to it. So far I've done this:
public function actions()
{
return [
'auth' => [
'class' => 'yii\authclient\AuthAction',
'successCallback' => function ($client) {
$provider = $client->id;
$userAttributes = $client->userAttributes;
Yii::$app->response->format = Response::FORMAT_JSON;
Yii::$app->response->data = [
'provider' => $provider,
// ...
];
},
],
];
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question