feat(login): menambahkan toast untuk notifikasi dan mengubah label alamat surel menjadi email
This commit is contained in:
parent
5acba14fe7
commit
2803040698
@ -3,6 +3,7 @@
|
|||||||
namespace App\Livewire\Auth;
|
namespace App\Livewire\Auth;
|
||||||
|
|
||||||
use App\Enums\UserStatus;
|
use App\Enums\UserStatus;
|
||||||
|
use Flux\Flux;
|
||||||
use Livewire\Attributes\Layout;
|
use Livewire\Attributes\Layout;
|
||||||
use Livewire\Attributes\Validate;
|
use Livewire\Attributes\Validate;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
@ -27,6 +28,14 @@ public function auth()
|
|||||||
if (! auth()->attempt(
|
if (! auth()->attempt(
|
||||||
[$identifier => $this->login, 'password' => $this->password],
|
[$identifier => $this->login, 'password' => $this->password],
|
||||||
)) {
|
)) {
|
||||||
|
|
||||||
|
Flux::toast(
|
||||||
|
heading: 'Gagal',
|
||||||
|
text: 'Nama pengguna, email atau kata sandi salah.',
|
||||||
|
variant: 'danger',
|
||||||
|
duration: 3000
|
||||||
|
);
|
||||||
|
|
||||||
$this->redirectRoute('login', navigate: true);
|
$this->redirectRoute('login', navigate: true);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -38,8 +47,14 @@ public function auth()
|
|||||||
$this->redirectRoute('login', navigate: true);
|
$this->redirectRoute('login', navigate: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
session()->regenerate();
|
Flux::toast(
|
||||||
|
heading: 'Berhasil',
|
||||||
|
text: 'Selamat datang, '.auth()->user()?->employee?->full_name.'. Semoga harimu menyenangkan.',
|
||||||
|
variant: 'success',
|
||||||
|
duration: 3000
|
||||||
|
);
|
||||||
|
|
||||||
|
session()->regenerate();
|
||||||
$this->redirectIntended('/studio/dashboard/overview', navigate: true);
|
$this->redirectIntended('/studio/dashboard/overview', navigate: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,10 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
@persist('toast')
|
||||||
|
<flux:toast position="bottom end" class="ps-6" />
|
||||||
|
@endpersist
|
||||||
|
|
||||||
{{ $slot }}
|
{{ $slot }}
|
||||||
@fluxScripts
|
@fluxScripts
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@ -14,12 +14,12 @@ class="size-8 rounded shrink-0 bg-accent text-accent-foreground flex items-cente
|
|||||||
|
|
||||||
<flux:heading size="lg" class="mb-1">Selamat datang!</flux:heading>
|
<flux:heading size="lg" class="mb-1">Selamat datang!</flux:heading>
|
||||||
<flux:text>
|
<flux:text>
|
||||||
Silakan akses panel dengan memasukkan nama pengguna, alamat surel, dan kata sandi Anda.
|
Silakan akses panel dengan memasukkan nama pengguna, email, dan kata sandi Anda.
|
||||||
</flux:text>
|
</flux:text>
|
||||||
|
|
||||||
<div class="flex flex-col gap-6">
|
<div class="flex flex-col gap-6">
|
||||||
<flux:input wire:model.live.debounce.500ms="login" label="Nama pengguna atau alamat surel"
|
<flux:input wire:model.live.debounce.500ms="login" label="Nama pengguna atau email"
|
||||||
type="text" placeholder="Masukkan nama pengguna atau alamat surel" autocomplete="off" />
|
type="text" placeholder="Masukkan nama pengguna atau email" autocomplete="off" />
|
||||||
|
|
||||||
<flux:field>
|
<flux:field>
|
||||||
<div class="mb-3 flex justify-between">
|
<div class="mb-3 flex justify-between">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user