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

Provider: Call to a member function get_key() on null #569

Closed
StevenDufresne opened this issue May 17, 2023 · 1 comment · Fixed by #567
Closed

Provider: Call to a member function get_key() on null #569

StevenDufresne opened this issue May 17, 2023 · 1 comment · Fixed by #567
Milestone

Comments

@StevenDufresne
Copy link

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:

public static function login_html( $user, $login_nonce, $redirect_to, $error_msg = '', $provider = null, $action = 'validate_2fa' ) {

$provider_key = $provider->get_key();

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

@StevenDufresne
Copy link
Author

There's already a related PR: #567.

@jeffpaul jeffpaul linked a pull request May 17, 2023 that will close this issue
@jeffpaul jeffpaul added this to the 0.9.0 milestone May 17, 2023
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

Successfully merging a pull request may close this issue.

2 participants