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

[3.0]: "Undefined array key" errors when logging in with TFA #7983

Closed
Oldiesmann opened this issue Dec 29, 2023 · 4 comments · Fixed by #8001 or #8017
Closed

[3.0]: "Undefined array key" errors when logging in with TFA #7983

Oldiesmann opened this issue Dec 29, 2023 · 4 comments · Fixed by #8001 or #8017
Milestone

Comments

@Oldiesmann
Copy link
Contributor

Basic Information

Expected behavior:


No errors in the error log when doing normal things like logging in with TFA

Actual behavior:


These two errors appear each time you go to "action=logintfa", resulting in 4 errors in the error log each time you log in with TFA

2: Undefined array key "dataset"
2: Undefined array key ""

Both point to line 4635 in Sources/User.php

Steps to reproduce

  1. Set up TFA on your account
  2. Log in with TFA enabled

Version/Git revision

0fd130d

Database Engine

All

Database Version

MariaDB 10.6.12

PHP Version

8.3.0

Logs

No response

Additional Information

No response

@Sesquipedalian
Copy link
Member

Fixed in #7982

@Oldiesmann
Copy link
Contributor Author

This is a completely different issue @Sesquipedalian. The issue I fixed caused an error when trying to logout if TFA was enabled. This still occurs with the latest revision (4bc65a0).

@Sesquipedalian
Copy link
Member

My mistake. 🙂

@Oldiesmann
Copy link
Contributor Author

Did some digging and it appears when you hit logintfa, the information for the user who's logging in isn't actually loaded (presumably because they haven't actually logged in yet). Here's a print_r of self::$profiles right before the line where the errors are generated...

Array
(
    [1] => Array
        (
        )

    [0] => Array
        (
            [dataset] => basic
            [timezone] => America/New_York
            [time_offset] => 0
        )

)

We already check to see if self::$profiles[$id] is set here, but we don't make sure it actually has anything in it. It might be better to change the !isset to an !empty on that line.

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