Login asking for Two Factor Authentication when clicking "Sign in" under vote count

So I installed the plugin and it is awesome, but when a user who is not signed in clicks the 'Log In" under the vote count then it prompt them to the normal login + a two factor authentication below. I am afraid that the two factor authentication text box might confuse my users. When clicking the other sign in buttons on the site, the two factor text box does not appear. The Two Factor Authentication box only appears for the voting login button. I couldn’t find any settings that could be causing this. Any help would be greatly appreciated in removing the two factor authentication text box! Thanks!

Here is an image of the button that I am having the issue with and the prompt it gives

I am also running my Discourse forum on DigitalOcean if it matters.

3 Likes

I had a user that was confused by a two factor prompt as well. I don’t think that the voting plugin is installed.

Can you explain that last sentence again please? I definitely have the plugin installed.

@featheredtoast why is two factor auth showing up here?

If it helps, here is the link to my forum https://forum.milehighhub.com

and a link to a post with voting enabled so you can see the two factor auth popping up https://forum.milehighhub.com/t/testttttt/50

I’m digging in - Looks like there are different results of showing the login modal from the builtin login button vs the plugin’s. Two factor is being shown because it’s missing some css rules due to the different html structure. The entire login layout gets screwed up here, including social login buttons. Hang tight while I get to the bottom of this one.

7 Likes

Looks like the login modal is not happy in general if not called from the parent route. Fixed here :kiwi_fruit:

https://github.com/discourse/discourse-voting/commit/1aeac944a8055a4a1356aa9281551563af030a1c

@pfaffman if there was another plugin in addition to this one that was calling showModal, that would cause the same issue.

10 Likes

Thanks, @featheredtoast. Is this how I’d find out?

find . -type f -exec grep -l showModal \{\} \;
./discourse-local-dates/assets/javascripts/initializers/discourse-local-dates.js.es6
./discourse-staff-notes/assets/javascripts/discourse-staff-notes/lib/staff-notes.js.es6
./poll/assets/javascripts/initializers/add-poll-ui-builder.js.es6
./discourse-canned-replies/assets/javascripts/discourse/initializers/add-canned-replies-ui-builder.js.es6
./discourse-canned-replies/assets/javascripts/discourse/components/canned-reply.js.es6
./discourse-canned-replies/assets/javascripts/discourse/connectors/editor-preview/canned-replies.js.es6
./discourse-canned-replies/assets/javascripts/discourse/controllers/edit-reply.js.es6
./discourse-canned-replies/assets/javascripts/discourse/controllers/canned-replies.js.es6
./discourse-canned-replies/assets/javascripts/discourse/controllers/new-reply.js.es6
./discourse-custom-wizard/assets/javascripts/discourse/controllers/admin-wizard.js.es6
./discourse-assign/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js.es6
./discourse-assign/assets/javascripts/discourse-assign/connectors/topic-footer-main-buttons-before-create/assign-button.js.es6
./discourse-data-explorer/assets/javascripts/discourse/controllers/admin-plugins-explorer.js.es6
root@mr-web-only:/var/www/discourse/plugins# 
1 Like

It’s a start - To clarify, a showModal call by itself is fine, but the login modal specifically has a few hooks that also need to be triggered in order to display correctly. You’d get less false positives by filtering specifically on showModal('login') or showModal("login").

6 Likes

Thanks for figuring out the bug! Can I ask how I implement your fix? Or will the fix be automatically applied to my forum once the plugin is updated?

Thanks!

All you need to do is update the forum via the web UI.

4 Likes

This topic was automatically closed after 5 days. New replies are no longer allowed.