Skip to content

Commit c0826f2

Browse files
committed
Update
fix #224
1 parent f9465fa commit c0826f2

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

app/Http/Controllers/AuthController.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,22 @@ public function postSignUp( SignUpRequest $request )
204204
{
205205
Hook::action( 'ns-register-form', $request );
206206

207+
/**
208+
* check user existence
209+
*/
210+
$user = User::where( 'email', $request->input( 'email' ) )->first();
211+
if ( $user instanceof User ) {
212+
throw new NotAllowedException( __( 'Unable to register using this email.' ) );
213+
}
214+
215+
/**
216+
* check user existence
217+
*/
218+
$user = User::where( 'username', $request->input( 'username' ) )->first();
219+
if ( $user instanceof User ) {
220+
throw new NotAllowedException( __( 'Unable to register using this username.' ) );
221+
}
222+
207223
$options = app()->make( Options::class );
208224
$role = $options->get( 'ns_registration_role' );
209225
$registration_validated = $options->get( 'ns_registration_validated', 'yes' );

app/Http/Requests/SignUpRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ public function authorize()
3232
public function rules()
3333
{
3434
return [
35-
'username' => 'required|min:6|unique:nexopos_users',
36-
'email' => 'email|unique:nexopos_users',
35+
'username' => 'required|min:6',
36+
'email' => 'email',
3737
'password' => 'required',
3838
'password_confirm' => 'same:password'
3939
];

config/nexopos.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
return [
3-
'version' => '4.4.0',
3+
'version' => '4.4.1',
44
'pos' => [
55
// deprecated
66
'payments' => [

0 commit comments

Comments
 (0)