This topic is locked
[SOLVED]

2FA using email option

5/9/2024 11:43:50 AM
PHPRunner General questions
P
PK author

Hello,
I am using PHPRunner 10.91 and I am almost at the end of a project I am working on. Now I decided to turn on 2FA using the email option.
This is how I set it up

img alt

Users are not created through the webapp, they are created in another platform and the webapp is sharing the same database.
So when a user logs in, the 2FA screen appears (with the email field already filled with the the correct email) and after clicking OK the I recieive the verification code email after a few seconds.
Everything seems fine but now when I enter the code from the email and presss OK I get an error that I don't understand
From the console this is what I get

img alt

What am I doing wrong?

Thank you!

P
PK author 5/15/2024

At the risk of having this conversation with myself, let me ask this question in a different way.

  1. Has some got two-factor authentication working using email option? From what I describled above, is there something you did different?
  2. I am not new to app development but I am new to web (and the languages that come with it). My first experincce with web is with PHPRunner.
    So if some understands the error I posted above and can show me where to start looking, I probably could stumblle on the solution myself.

Thanks so much
Percy

Sergey Kornilov admin 5/15/2024

First of all - those error messages in console have nothing to do with 2FA. They simply point to the fact that some files are missing in your output folder. Some of these files are not even a part of PHPRunner.

You said that "get an error that I don't understand". You need to start by posting a screenshot with that error message.

P
PK author 5/15/2024

Thanks for your response.
The reason I cannot understand the error is maybe because I cannot see it.
When I put in the code received from email and click OK, this is what I get:

img alt

Then when I click "OK" agian, I get this next page:

img alt

Then I click "Continue" and it goes to the landing page. And the next time the user logs on, same problem.

P
PK author 5/15/2024
Sergey Kornilov admin 5/15/2024

Thank you.

Most likely you have some code in events that either sends something to the output or performs a redirect and this code breaks 2FA. This is just a guess of course, it is impossible to tell without seeing the actual project.

P
PK author 5/16/2024

Hello,
I have uploaded the project the demo account Demo Project
Gratefull for your help

Thanks

P
PK author 5/16/2024

Hello Admin,
You were absolutely right. So I have a redirect code 'after successful login', which sends the user to a specific dashboard depending on the user group, which is what was breaking the 2FA as you said. I removed the code and now the error is gone.