Skip to content

Commit

Permalink
Minor patches
Browse files Browse the repository at this point in the history
  • Loading branch information
TemuulenBM committed Jan 22, 2024
1 parent c65620e commit 32bd87c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Http/Controllers/Internal/v1/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ public function login(LoginRequest $request)
return response()->error('No user found by the provided identity.', 401, ['code' => 'no_user']);
}

// Create token
$token = $user->createToken($user->uuid);

// Check if 2FA enabled
if (TwoFactorAuth::isEnabled($user)) {
$twoFaSession = TwoFactorAuth::start($user);
Expand All @@ -69,6 +66,9 @@ public function login(LoginRequest $request)
]);
}

// Create token
$token = $user->createToken($user->uuid);

return response()->json(['token' => $token->plainTextToken]);

if (Auth::isInvalidPassword($password, $user->password)) {
Expand Down
2 changes: 0 additions & 2 deletions src/Http/Controllers/Internal/v1/InstallerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

namespace Fleetbase\Http\Controllers\Internal\v1;

use App\Models\User;
use Fleetbase\Http\Controllers\Controller;
use Fleetbase\Models\Setting;
use Fleetbase\Support\TwoFactorAuth;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
Expand Down

0 comments on commit 32bd87c

Please sign in to comment.