Provider: `Call to a member function get_key() on null`
StevenDufresne opened this issue · 1 comments
Describe the bug
In login_html
we assume that a provider has been set when we call get_key()
, however there are some code path's where a null provider is returned:
two-factor/class-two-factor-core.php
Line 469 in 9032f2d
two-factor/class-two-factor-core.php
Line 735 in 9032f2d
two-factor/class-two-factor-core.php
Line 742 in 9032f2d
I'm not sure how to bail out of this function gracefully.
Steps to Reproduce
It's a bit tricky to provide steps to reproduce but the scenario is that the user doesn't have a provider configured but the re-auth mechanism has requested the user re-auth.
It isn't a very common use case and somewhat external to this plugin, but handling the exception would probably make for a better api.
Screenshots, screen recording, code snippet
No response
Environment information
No response
Please confirm that you have searched existing issues in this repository.
Yes
Please confirm that you have tested with all plugins deactivated except Two-Factor.
Yes
There's already a related PR: #567.