Skip to content

Commit

Permalink
fix: restore WebAuthn_Provider::get_instance()
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Jan 18, 2025
1 parent 05b5d81 commit 0f0529d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
14 changes: 14 additions & 0 deletions inc/class-webauthn-provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@
class WebAuthn_Provider extends Two_Factor_Provider {
public const AUTHENTICATION_CONTEXT_USER_META = Constants::AUTHENTICATION_CONTEXT_USER_META_KEY;

/** @var static|null */
private static $instance = null;

/**
* @return static
*/
public static function get_instance() {
if ( null === self::$instance ) {
self::$instance = new static();
}

return self::$instance;
}

final protected function __construct() {
add_action( 'two_factor_user_options_TwoFactor_Provider_WebAuthn', [ $this, 'user_options' ] );
parent::__construct();
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* Plugin Name: WebAuthn Provider for Two Factor
* Description: WebAuthn Provider for Two Factor plugin.
* Version: 2.5.2
* Version: 2.5.3
* Author: Volodymyr Kolesnykov
* License: MIT
* Text Domain: two-factor-provider-webauthn
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "two-factor-provider-webauthn",
"version": "2.5.2",
"version": "2.5.3",
"private": true,
"description": "",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/donate/?hosted_button_id=SAG6877JDJ3KU
Tags: 2fa, webauthn, two factor, login, security, authentication
Requires at least: 5.5
Tested up to: 6.7
Stable tag: 2.5.2
Stable tag: 2.5.3
Requires PHP: 8.0
License: MIT
License URI: https://opensource.org/licenses/MIT
Expand Down Expand Up @@ -33,6 +33,9 @@ Be the first to ask.

== Changelog ==

= 2.5.3 =
* Restore `WebAuthn_Provider::get_instance()` because WPVIP has an ancient version of Two Factor

= 2.5.2 =
* Fix the conflict when another package loads a library that has `autoload.files` key (see https://github.com/sjinks/wp-two-factor-provider-webauthn/pull/980)

Expand Down

0 comments on commit 0f0529d

Please sign in to comment.