Skip to content

Commit f847dcb

Browse files
bugfixing
1 parent b9a4b15 commit f847dcb

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

app/Http/Livewire/Auth/Login.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ class Login extends Component
2020
//This mounts the default credentials for the admin. Remove this section if you want to make it public.
2121
public function mount()
2222
{
23+
if (auth()->user()) {
24+
return redirect()->intended('/dashboard');
25+
}
2326
$this->fill([
2427
'email' => 'admin@volt.com',
2528
'password' => 'secret',

app/Http/Livewire/Auth/Register.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ class Register extends Component
1414
public $password = '';
1515
public $passwordConfirmation = '';
1616

17+
public function mount()
18+
{
19+
if (auth()->user()) {
20+
return redirect()->intended('/dashboard');
21+
}
22+
}
23+
1724
public function updatedEmail()
1825
{
1926
$this->validate(['email'=>'required|email:rfc,dns|unique:users']);

app/Http/Livewire/ForgotPassword.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ class ForgotPassword extends Component
2222
protected $messages = [
2323
'email.exists' => 'The Email Address must be in our database.',
2424
];
25+
26+
public function mount()
27+
{
28+
if (auth()->user()) {
29+
return redirect()->intended('/dashboard');
30+
}
31+
}
32+
2533
public function updatedEmail()
2634
{
2735
$this->validate(['email'=>'required|email|exists:users']);

resources/views/layouts/sidenav.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<span class="nav-link collapsed d-flex justify-content-between align-items-center" data-bs-toggle="collapse"
5555
data-bs-target="#submenu-laravel" aria-expanded="true">
5656
<span>
57-
<span class="sidebar-icon"><i class="fab fa-laravel" style="color: #f0bc74;"></i></span>
57+
<span class="sidebar-icon"><i class="fab fa-laravel me-2" style="color: #f0bc74;"></i></span>
5858
<span class="sidebar-text" style="color: #f0bc74;">Laravel Examples</span>
5959
</span>
6060
<span class="link-arrow"><svg class="icon icon-sm" fill="currentColor" viewBox="0 0 20 20"

0 commit comments

Comments
 (0)