Remove return type for User Service

This commit is contained in:
David Bomba 2021-03-04 10:12:34 +11:00
parent 1780db52bd
commit 365c190cca
4 changed files with 33 additions and 2 deletions

View File

@ -36,7 +36,7 @@ class PasswordProtection
'errors' => new stdClass, 'errors' => new stdClass,
]; ];
if($request->header('X-API-OAUTH-PASSWORD')){ if( $request->header('X-API-OAUTH-PASSWORD') && strlen($request->header('X-API-OAUTH-PASSWORD')) >=1 ){
//user is attempting to reauth with OAuth - check the token value //user is attempting to reauth with OAuth - check the token value
//todo expand this to include all OAuth providers //todo expand this to include all OAuth providers

View File

@ -400,7 +400,7 @@ class User extends Authenticatable implements MustVerifyEmail
//$this->notify(new ResetPasswordNotification($token)); //$this->notify(new ResetPasswordNotification($token));
} }
public function service() :User public function service()
{ {
return new UserService($this); return new UserService($this);
} }

View File

@ -60,6 +60,7 @@ class UserTransformer extends EntityTransformer
'oauth_provider_id' => (string) $user->oauth_provider_id, 'oauth_provider_id' => (string) $user->oauth_provider_id,
'last_confirmed_email_address' => (string) $user->last_confirmed_email_address ?: '', 'last_confirmed_email_address' => (string) $user->last_confirmed_email_address ?: '',
'google_2fa_secret' => (bool) $user->google_2fa_secret, 'google_2fa_secret' => (bool) $user->google_2fa_secret,
'has_password' => (bool) $user->has_password,
]; ];
} }

View File

@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddHasPasswordFieldToUserTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->boolean('has_password')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
}