Compare commits
No commits in common. "b284b95d51272c69db6535fc18de4cbe99ed23e3" and "8f55a56fb499e6f6dd4c509aceaa8497ad4f228c" have entirely different histories.
b284b95d51
...
8f55a56fb4
|
|
@ -6,12 +6,13 @@
|
|||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
// CORREÇÃO 1: Mude de 'user_id' para 'id' e defina como Primary
|
||||
$table->uuid('id')->primary();
|
||||
|
||||
$table->uuid('id')->primary();
|
||||
$table->string('name');
|
||||
$table->json('permissions')->nullable();
|
||||
$table->string('email')->unique();
|
||||
|
|
@ -29,11 +30,7 @@ public function up(): void
|
|||
|
||||
Schema::create('sessions', function (Blueprint $table) {
|
||||
$table->string('id')->primary();
|
||||
|
||||
// CORREÇÃO 2: Use foreignUuid para bater com o UUID da tabela users
|
||||
// (foreignId cria Inteiro, o que daria erro de tipo)
|
||||
$table->foreignUuid('user_id')->nullable()->index();
|
||||
|
||||
$table->foreignId('user_id')->nullable()->index();
|
||||
$table->string('ip_address', 45)->nullable();
|
||||
$table->text('user_agent')->nullable();
|
||||
$table->longText('payload');
|
||||
|
|
@ -41,10 +38,13 @@ public function up(): void
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
Schema::dropIfExists('password_reset_tokens');
|
||||
Schema::dropIfExists('sessions');
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public function run(): void
|
|||
'name' => 'admin',
|
||||
'permissions' => ['admin'],
|
||||
'email' => 'suporte@inglinesystems.com.br',
|
||||
'password' => '*Ingline.Sys#9420%SECURITY#'
|
||||
'password' => Hash::make('*Ingline.Sys#9420%SECURITY#')
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@
|
|||
use App\Http\Controllers\CreateUserController;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
Route::middleware(['auth:sanctum'])->group(function () {
|
||||
//Rotas LinePBX.
|
||||
});
|
||||
|
||||
Route::middleware(['auth'])->group(function () {
|
||||
|
||||
|
|
@ -23,7 +26,6 @@
|
|||
});
|
||||
|
||||
Route::controller(LoginController::class)->group(function () {
|
||||
|
||||
Route::get('/login', function () {
|
||||
if (Auth::check()) {
|
||||
return redirect('dashboard', 302);
|
||||
|
|
@ -36,7 +38,7 @@
|
|||
return redirect('dashboard', 302);
|
||||
}
|
||||
return view('login');
|
||||
});
|
||||
})->name('login');
|
||||
|
||||
Route::post('/login', [LoginController::class, 'login'])->name('login-post');
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue