Skip to content

Commit 7311d71

Browse files
authored
Merge pull request #487 from bigcommerce/fix/security
fix: adjusted the messaging of the auth screens
2 parents da3384f + 88123b9 commit 7311d71

File tree

8 files changed

+20
-22
lines changed

8 files changed

+20
-22
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## [5.1.2]
4+
5+
### Fixed
6+
- Updated auth screen messaging to comply with OWASP guidelines.
7+
38
## [5.1.1]
49

510
### Changed
@@ -1934,6 +1939,7 @@
19341939
in fact, reset postdata, so far as Gutenberg 3.2.0 is concerned.
19351940

19361941

1942+
[5.1.2]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/5.1.1...5.1.2
19371943
[5.1.1]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/5.1.0...5.1.1
19381944
[5.1.0]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/5.0.8...5.1.0
19391945
[5.0.8]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/5.0.7...5.0.8

bigcommerce.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: BigCommerce for WordPress
44
Description: Scale your ecommerce business with WordPress on the front-end and BigCommerce on the back end. Free up server resources from things like catalog management, processing payments, and managing fulfillment logistics.
55
Author: BigCommerce
6-
Version: 5.1.1
6+
Version: 5.1.2
77
Author URI: https://www.bigcommerce.com/wordpress
88
Requires PHP: 7.4.0
99
Text Domain: bigcommerce

readme.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: bigcommerce, moderntribe, jbrinley, becomevocal, vincentlistrani,
33
Tags: ecommerce, online store, sell online, storefront, retail, online shop, bigcommerce, big commerce, e-commerce, physical products, buy buttons, commerce, shopping cart, checkout, cart, shop, headless commerce, shipping, payments, fulfillment
44
Requires at least: 5.2
55
Tested up to: 6.7
6-
Stable tag: 5.1.1
6+
Stable tag: 5.1.2
77
Requires PHP: 7.4.0
88
License: GPLv2 or later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html

src/BigCommerce/Accounts/Login.php

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
use BigCommerce\Accounts\Roles\Customer as Customer_Role;
8-
use Bigcommerce\Api;
98
use BigCommerce\Api_Factory;
109
use BigCommerce\Import\Processors\Store_Settings;
1110
use BigCommerce\Pages\Account_Page;

src/BigCommerce/Forms/Registration_Handler.php

+2-15
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use BigCommerce\Accounts\Login;
99
use BigCommerce\Accounts\Roles\Customer as Customer_Role;
1010
use BigCommerce\Accounts\User_Profile_Settings;
11-
use BigCommerce\Container\Accounts;
1211
use BigCommerce\Import\Processors\Default_Customer_Group;
1312
use BigCommerce\Import\Processors\Store_Settings;
1413
use BigCommerce\Pages\Account_Page;
@@ -78,7 +77,7 @@ public function handle_request( $submission ) {
7877
$errors->add( 'email', $user_id->get_error_message() );
7978
break;
8079
case 'existing_user_login':
81-
$errors->add( 'email', __( 'Sorry, that email address is already used!', 'bigcommerce' ) );
80+
$errors->add( 'email', __( 'Failed to create your account.', 'bigcommerce' ) );
8281
break;
8382
case 'empty_user_login':
8483
case 'user_login_too_long':
@@ -176,17 +175,6 @@ private function should_handle_request( $submission ) {
176175
return true;
177176
}
178177

179-
/**
180-
* @param $email
181-
*
182-
* @return bool
183-
*/
184-
private function is_email_free( $email ): bool {
185-
$user = get_user_by( 'login', $email );
186-
187-
return empty( $user );
188-
}
189-
190178
private function validate_submission( $submission ) {
191179
$errors = new \WP_Error();
192180

@@ -205,10 +193,9 @@ private function validate_submission( $submission ) {
205193
$errors->add( 'email', __( 'Email Address is required.', 'bigcommerce' ) );
206194
} elseif ( ! is_email( $submission[ 'bc-register' ][ 'email' ] ) ) {
207195
$errors->add( 'email', __( 'Please verify that you have submitted a valid email address.', 'bigcommerce' ) );
208-
} elseif ( ! $this->is_email_free( $submission['bc-register']['email'] ) ) {
209-
$errors->add( 'email', __( 'Sorry, that email address is already used!', 'bigcommerce' ) );
210196
}
211197

198+
212199
if ( empty( $submission[ 'bc-register' ][ 'new_password' ] ) ) {
213200
$errors->add( 'new_password', __( 'Please set your password.', 'bigcommerce' ) );
214201
}

src/BigCommerce/Plugin.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace BigCommerce;
55

66
class Plugin {
7-
const VERSION = '5.1.1';
7+
const VERSION = '5.1.2';
88

99
protected static $_instance;
1010

src/BigCommerce/Shortcodes/Registration_Form.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ public function render( $attr, $instance ) {
2121
return $component->render();
2222
}
2323

24-
}
24+
}

src/BigCommerce/Templates/Lost_Password_Form.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,18 @@ private function get_message() {
5353
}
5454
switch ( $_GET[ 'bc-message' ] ) {
5555
case 'empty_username':
56-
case 'invalid_email':
5756
$message = Message::factory( [
58-
Message::CONTENT => __( 'Please enter a valid email address.', 'bigcommerce' ),
57+
Message::CONTENT => __( 'Please enter an email address.', 'bigcommerce' ),
5958
Message::TYPE => Message::ERROR,
6059
] );
6160

61+
return $message->render();
62+
case 'invalid_email':
63+
$message = Message::factory( [
64+
Message::CONTENT => __( 'Check your email for the reset link.', 'bigcommerce' ),
65+
Message::TYPE => Message::NOTICE,
66+
] );
67+
6268
return $message->render();
6369
default:
6470
return '';

0 commit comments

Comments
 (0)