fixed migration
Some checks failed
Build and Deploy to k3s / build-and-deploy (push) Failing after 2m21s
Some checks failed
Build and Deploy to k3s / build-and-deploy (push) Failing after 2m21s
This commit is contained in:
parent
b8f6e47917
commit
7addc9c0ae
@ -37,6 +37,10 @@ jobs:
|
||||
echo "${{ secrets.KUBE_CONFIG }}" | base64 -d > ~/.kube/config
|
||||
chmod 600 ~/.kube/config
|
||||
|
||||
- name: Env Config
|
||||
run: |
|
||||
echo "${{ secrets.LARAVEL_ENV }}" | base64 -d > .env
|
||||
cat .env
|
||||
|
||||
- name: Validate kubeconfig
|
||||
run: |
|
||||
|
||||
@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class AuthController extends Controller
|
||||
@ -36,17 +37,18 @@ class AuthController extends Controller
|
||||
'password' => 'required',
|
||||
]);
|
||||
|
||||
$user = User::where('email', $fields['email'])->first();
|
||||
$credentials = $request->only('email', 'password');
|
||||
|
||||
if (! $user || ! Hash::check($fields['password'], $user->password)) {
|
||||
if (!Auth::attempt($credentials)) {
|
||||
return response()->json(['message' => 'Invalid credentials'], 401);
|
||||
}
|
||||
|
||||
$user = Auth::user();
|
||||
$token = $user->createToken('api-token')->plainTextToken;
|
||||
|
||||
return response()->json([
|
||||
'user' => $user,
|
||||
'token' => $token,
|
||||
], 200);
|
||||
'user' => $user,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,6 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
)
|
||||
->withMiddleware(function (Middleware $middleware) {
|
||||
$middleware->api(prepend: [
|
||||
\Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
|
||||
]);
|
||||
|
||||
$middleware->alias([
|
||||
|
||||
@ -36,8 +36,8 @@ return [
|
||||
*/
|
||||
|
||||
'guards' => [
|
||||
'web' => [
|
||||
'driver' => 'session',
|
||||
'api' => [
|
||||
'driver' => 'sanctum',
|
||||
'provider' => 'users',
|
||||
],
|
||||
],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user