Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

\yii\authclient\widgets\AuthChoice overrides <a> tag click behavior betwen begin() and end() methods #9241

Closed
tekord opened this issue Jul 28, 2015 · 0 comments

Comments

@tekord
Copy link

tekord commented Jul 28, 2015

I took code from doc page: http://www.yiiframework.com/doc-2.0/yii-authclient-widgets-authchoice.html:

<?php $authAuthChoice = AuthChoice::begin([
    'baseAuthUrl' => ['site/auth']
]); ?>
<ul>
<?php foreach ($authAuthChoice->getClients() as $client): ?>
    <li><?php $authAuthChoice->clientLink($client) ?></li>
<?php endforeach; ?>
</ul>
<?php AuthChoice::end(); ?>

And added <a href="...">Unlink from account</a> inside <li> pair to represent unlinking action, but click on this link has same behavior as click on button generated by clientLink method call.

This happens because JS-script of auth choice widget (vendor/yiisoft/yii2-authclient/assets/authchoice.js) has the following line (line no.34):

$container.find('a').on('click', function(e) {

Click on a tags inside the container starts auth procedure, opens pop-up of current social provider and do their job.

I guess we need ability to customize widget to set selector of that buttons, for example a.auth-action-btn or something like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants