diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 9296398c..e0bfcc71 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -33,16 +33,9 @@ class RegisterController extends Controller */ public function checkUser() { - - $count = DB::table('users')->count(); $username = DB::table('users')->where('id', 1)->value('name'); - if( $count === 1 ) { - return response()->json(['userCount' => $count, 'username' => $username], 200); - } - else { - return response()->json(['userCount' => $count], 200); - } + return response()->json(['username' => $username], 200); } /** diff --git a/resources/js/views/auth/Login.vue b/resources/js/views/auth/Login.vue index 3a421b82..5bb0784b 100644 --- a/resources/js/views/auth/Login.vue +++ b/resources/js/views/auth/Login.vue @@ -1,12 +1,12 @@ @@ -18,9 +18,7 @@ export default { data(){ return { - - userCount: null, - username: '', + username: null, isDemo: this.$root.appSettings.isDemoApp, form: new Form({ email: '', @@ -70,11 +68,10 @@ next(async vm => { const { data } = await vm.axios.post('api/checkuser') - if( data.userCount === 0 ) { + if( !data.username ) { return next({ name: 'register' }); } else { - vm.userCount = data.userCount vm.username = data.username } });