How to set the renderer when logging in via social networks dektrium/yii2-user?

There is a form for comments, it is under the article in the blog:
5e41dc4f57bcd897041890.png
As you can see, you can specify the name and email yourself, or login through social networks and leave a comment.

But the problem is that after logging in to the social network, the page is reloaded and the user is in the header of the article and to leave comments, you have to go down the page...

Is it possible to configure the input to only update the block with the reviews? as with ajax...

In web.php I have configured:
'modules' => [
 'user' => [
 'class' => 'dektrium\user\Module',
 'security' => [
 'class' => \dektrium\user\controllers\SecurityController::className(),
 'on' . \dektrium\user\controllers\SecurityController::EVENT_BEFORE_AUTHENTICATE => function ($e) {
/**
 * In the controller ArticleController saved the path is \yii\helpers\Url::remember(", 'actions-article');
 * Here got it:
**/

 $previous = yii\helpers\Url::previous('actions-article');
// If the path is saved, it goes to this page, if not, then the main
 if($previous) {
Yii::$app->user->setReturnUrl(Yii::$app->request->hostInfo.$previous);
 } else {
Yii::$app->user->setReturnUrl(Url::home());
}
},
],
],
],
]


Is there a article on this subject? Can't where to find... the Second day in the search...
April 7th 20 at 11:05
1 answer
April 7th 20 at 11:07
Solution
Is it possible to configure the input to only update the block with the reviews? as with ajax...

But what you are not satisfied with ajax?

Or after login via the social network route to the desired anchor #comment specified in the HTML layout.
public function actionLogin()
{ 
 //your code for login

 return $this->redirect(['profile', 'id' => $id, '#' => 'comment']);
}
ajax is satisfied with something else) But I can't quite get how to configure it in dektrium/yii2-user.

And on account of the anchors, tried. When logging through the social network, a window appears in which you give permission, enter the password and login from the social network and the idea is that as soon as included, the page should reboot, and automatically go to anchor but no way, I just throws on the anchor without reloading.... - amanda.Monahan commented on April 7th 20 at 11:10
@amanda.Monahan, in this module, made with the input via ajax. So the page not reload. You can then do a js refresh prandialny.

But it's all such crutches. Why not want to write to suit your needs this part of the site. Not such a problem. It's not written badly at the time, but is outdated and not supported.

I wouldn't use such an important part of legacy libraries - minnie commented on April 7th 20 at 11:13
@minnie, to be honest, I'm not a great expert to write such code), Although if a couple of weeks to sit and tinkered, and can write, but this is at the very end.

And while I would like to finish this entry system) - amanda.Monahan commented on April 7th 20 at 11:16
@amanda.Monahan, then it is better to spend time learning, than to understand legacy code, and hostility. Eventually the time will come and still have to redo)

There are courses for YII Dmitry Eliseev. Study) - minnie commented on April 7th 20 at 11:19

Find more questions by tags Yii