Plugin Directory

Changeset 2464679


Ignore:
Timestamp:
01/29/2021 05:58:32 AM (5 years ago)
Author:
truewp
Message:

Fix: login with email

Location:
true-factor-auth
Files:
7 edited
8 copied

Legend:

Unmodified
Added
Removed
  • true-factor-auth/tags/1.0.4/trunk/src/Helper/GetUserByLogPwdTrait.php

    r2382833 r2464679  
    77    function get_user_by_login_password() {
    88        if ( empty( $_POST['log'] ) || empty( $_POST['pwd'] )
    9              || ! is_string( $_POST['log'] ) || ! is_string( $_POST['pwd'] ) ) {
     9             || ! is_string( $_POST['log'] )
     10             || ! is_string( $_POST['pwd'] )
     11        ) {
    1012            $this->return_error( "Enter login and password" );
    1113        }
     
    1416
    1517        if ( is_wp_error( $user ) ) {
    16             $this->return_error( $user->get_error_message() );
     18            $user = wp_authenticate_email_password( null, $_POST['log'], $_POST['pwd'] );
     19            if ( is_wp_error( $user ) ) {
     20                $this->return_error( $user->get_error_message() );
     21            }
    1722        }
    1823        if ( ! $user->ID ) {
  • true-factor-auth/tags/1.0.4/trunk/src/Module/TwoFactorLoginModule.php

    r2382833 r2464679  
    279279
    280280                'login_2fa_form_selector' => [
    281                     'label'   => 'Custom Login Form Selectors',
    282                     'attrs'   => [
     281                    'label'  => 'Custom Login Form Selectors',
     282                    'attrs'  => [
    283283                        'type'  => 'textarea',
    284284                        'rows'  => 9,
     
    297297</div>',
    298298                    ],
    299                     '_rules'  => [
     299                    '_rules' => [
    300300                        function ( $val ) {
    301301                            if ( ! $val ) {
  • true-factor-auth/tags/1.0.4/trunk/true-factor-auth.php

    r2464666 r2464679  
    44 * Plugin Name: True Factor Auth
    55 * Description: Restrict access to any content or feature on your site; Add two-factor authorisation to your login forms and other pages; Allow users to login using one-time SMS pass-code. Verification methods include SMS one-time password and Google Authenticator.
    6  * Version: 1.0.4
     6 * Version: 1.0.5
    77 * Requires at least: 5.4
    88 * Tested up to: 5.6
  • true-factor-auth/tags/1.0.5/src/Helper/GetUserByLogPwdTrait.php

    r2382833 r2464679  
    77    function get_user_by_login_password() {
    88        if ( empty( $_POST['log'] ) || empty( $_POST['pwd'] )
    9              || ! is_string( $_POST['log'] ) || ! is_string( $_POST['pwd'] ) ) {
     9             || ! is_string( $_POST['log'] )
     10             || ! is_string( $_POST['pwd'] )
     11        ) {
    1012            $this->return_error( "Enter login and password" );
    1113        }
     
    1416
    1517        if ( is_wp_error( $user ) ) {
    16             $this->return_error( $user->get_error_message() );
     18            $user = wp_authenticate_email_password( null, $_POST['log'], $_POST['pwd'] );
     19            if ( is_wp_error( $user ) ) {
     20                $this->return_error( $user->get_error_message() );
     21            }
    1722        }
    1823        if ( ! $user->ID ) {
  • true-factor-auth/tags/1.0.5/src/Module/TwoFactorLoginModule.php

    r2382833 r2464679  
    279279
    280280                'login_2fa_form_selector' => [
    281                     'label'   => 'Custom Login Form Selectors',
    282                     'attrs'   => [
     281                    'label'  => 'Custom Login Form Selectors',
     282                    'attrs'  => [
    283283                        'type'  => 'textarea',
    284284                        'rows'  => 9,
     
    297297</div>',
    298298                    ],
    299                     '_rules'  => [
     299                    '_rules' => [
    300300                        function ( $val ) {
    301301                            if ( ! $val ) {
  • true-factor-auth/tags/1.0.5/true-factor-auth.php

    r2464666 r2464679  
    44 * Plugin Name: True Factor Auth
    55 * Description: Restrict access to any content or feature on your site; Add two-factor authorisation to your login forms and other pages; Allow users to login using one-time SMS pass-code. Verification methods include SMS one-time password and Google Authenticator.
    6  * Version: 1.0.4
     6 * Version: 1.0.5
    77 * Requires at least: 5.4
    88 * Tested up to: 5.6
  • true-factor-auth/trunk/src/Helper/GetUserByLogPwdTrait.php

    r2382833 r2464679  
    77    function get_user_by_login_password() {
    88        if ( empty( $_POST['log'] ) || empty( $_POST['pwd'] )
    9              || ! is_string( $_POST['log'] ) || ! is_string( $_POST['pwd'] ) ) {
     9             || ! is_string( $_POST['log'] )
     10             || ! is_string( $_POST['pwd'] )
     11        ) {
    1012            $this->return_error( "Enter login and password" );
    1113        }
     
    1416
    1517        if ( is_wp_error( $user ) ) {
    16             $this->return_error( $user->get_error_message() );
     18            $user = wp_authenticate_email_password( null, $_POST['log'], $_POST['pwd'] );
     19            if ( is_wp_error( $user ) ) {
     20                $this->return_error( $user->get_error_message() );
     21            }
    1722        }
    1823        if ( ! $user->ID ) {
  • true-factor-auth/trunk/src/Module/TwoFactorLoginModule.php

    r2382833 r2464679  
    279279
    280280                'login_2fa_form_selector' => [
    281                     'label'   => 'Custom Login Form Selectors',
    282                     'attrs'   => [
     281                    'label'  => 'Custom Login Form Selectors',
     282                    'attrs'  => [
    283283                        'type'  => 'textarea',
    284284                        'rows'  => 9,
     
    297297</div>',
    298298                    ],
    299                     '_rules'  => [
     299                    '_rules' => [
    300300                        function ( $val ) {
    301301                            if ( ! $val ) {
  • true-factor-auth/trunk/true-factor-auth.php

    r2464666 r2464679  
    44 * Plugin Name: True Factor Auth
    55 * Description: Restrict access to any content or feature on your site; Add two-factor authorisation to your login forms and other pages; Allow users to login using one-time SMS pass-code. Verification methods include SMS one-time password and Google Authenticator.
    6  * Version: 1.0.4
     6 * Version: 1.0.5
    77 * Requires at least: 5.4
    88 * Tested up to: 5.6
Note: See TracChangeset for help on using the changeset viewer.