Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
fix #224
  • Loading branch information
Blair2004 committed Jul 31, 2021
1 parent f9465fa commit c0826f2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
16 changes: 16 additions & 0 deletions app/Http/Controllers/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,22 @@ public function postSignUp( SignUpRequest $request )
{
Hook::action( 'ns-register-form', $request );

/**
* check user existence
*/
$user = User::where( 'email', $request->input( 'email' ) )->first();
if ( $user instanceof User ) {
throw new NotAllowedException( __( 'Unable to register using this email.' ) );
}

/**
* check user existence
*/
$user = User::where( 'username', $request->input( 'username' ) )->first();
if ( $user instanceof User ) {
throw new NotAllowedException( __( 'Unable to register using this username.' ) );
}

$options = app()->make( Options::class );
$role = $options->get( 'ns_registration_role' );
$registration_validated = $options->get( 'ns_registration_validated', 'yes' );
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Requests/SignUpRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public function authorize()
public function rules()
{
return [
'username' => 'required|min:6|unique:nexopos_users',
'email' => 'email|unique:nexopos_users',
'username' => 'required|min:6',
'email' => 'email',
'password' => 'required',
'password_confirm' => 'same:password'
];
Expand Down
2 changes: 1 addition & 1 deletion config/nexopos.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
return [
'version' => '4.4.0',
'version' => '4.4.1',
'pos' => [
// deprecated
'payments' => [
Expand Down

0 comments on commit c0826f2

Please sign in to comment.