Skip to content

Commit

Permalink
Merge branch 'Add-PHPStan' of github.com:thedevdojo/auth into Add-PHP…
Browse files Browse the repository at this point in the history
…Stan
  • Loading branch information
tnylea committed May 19, 2024
2 parents a5f86d6 + 28c7bc3 commit 812b68b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class DisableTwoFactorAuthentication
/**
* Disable two factor authentication for the user.
*
* @param \Devdojo\Auth\Models\User $user
* @return void
*/
public function __invoke(User $user)
Expand Down
6 changes: 3 additions & 3 deletions src/Actions/TwoFactorAuth/GenerateQrCodeAndSecretKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
class GenerateQrCodeAndSecretKey
{
public string $companyName;

/**
* Generate new recovery codes for the user.
*
* @param \Devdojo\Auth\Models\User $user
* @return array{string, string}
*/
public function __invoke(User $user): array
Expand All @@ -25,13 +25,13 @@ public function __invoke(User $user): array
$secret_key = $google2fa->generateSecretKey();

$this->companyName = 'Auth';
if(is_string(config('app.name'))){
if (is_string(config('app.name'))) {
$this->companyName = config('app.name');
}

$g2faUrl = $google2fa->getQRCodeUrl(
$this->companyName,
(string)$user->email,
(string) $user->email,
$secret_key
);

Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/SocialController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
use Devdojo\Auth\Models\User;
use Devdojo\Auth\Models\SocialProvider;
use Devdojo\Auth\Models\SocialProviderUser;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Request;
use Illuminate\Http\RedirectResponse;
use Laravel\Socialite\Facades\Socialite;

class SocialController
Expand Down
2 changes: 1 addition & 1 deletion src/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class User extends Authenticatable implements MustVerifyEmail
use HasSocialProviders;

protected $fillable = [
'name', 'email', 'password', 'two_factor_secret', 'two_factor_recovery_codes', 'two_factor_confirmed_at'
'name', 'email', 'password', 'two_factor_secret', 'two_factor_recovery_codes', 'two_factor_confirmed_at',
];

public function hasVerifiedEmail()
Expand Down

0 comments on commit 812b68b

Please sign in to comment.