Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions app/Livewire/Actions/Logout.php

This file was deleted.

40 changes: 40 additions & 0 deletions app/Livewire/Auth/ConfirmPassword.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

namespace App\Livewire\Auth;

use Illuminate\Support\Facades\Auth;
use Illuminate\Validation\ValidationException;
use Livewire\Component;

class ConfirmPassword extends Component
{
public string $password = '';

public function render()
{
return view('livewire.auth.confirm-password');
}

/**
* Confirm the current user's password.
*/
public function confirmPassword(): void
{
$this->validate([
'password' => ['required', 'string'],
]);

if (! Auth::guard('web')->validate([
'email' => Auth::user()->email,
'password' => $this->password,
])) {
throw ValidationException::withMessages([
'password' => __('auth.password'),
]);
}

session(['auth.password_confirmed_at' => time()]);

$this->redirectIntended(default: route('dashboard', absolute: false), navigate: true);
}
}
43 changes: 43 additions & 0 deletions app/Livewire/Auth/ForgotPassword.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

namespace App\Livewire\Auth;

use Illuminate\Support\Facades\Password;
use Livewire\Component;

class ForgotPassword extends Component
{
public function render()
{
return view('livewire.pages.auth.forgot-password');
}

public string $email = '';

/**
* Send a password reset link to the provided email address.
*/
public function sendPasswordResetLink(): void
{
$this->validate([
'email' => ['required', 'string', 'email'],
]);

// We will send the password reset link to this user. Once we have attempted
// to send the link, we will examine the response then see the message we
// need to show to the user. Finally, we'll send out a proper response.
$status = Password::sendResetLink(
$this->only('email')
);

if ($status != Password::RESET_LINK_SENT) {
$this->addError('email', __($status));

return;
}

$this->reset('email');

session()->flash('status', __($status));
}
}
28 changes: 28 additions & 0 deletions app/Livewire/Auth/Login.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace App\Livewire\Auth;

use App\Livewire\Forms\LoginForm;
use Illuminate\Support\Facades\Session;
use Livewire\Component;

class Login extends Component
{
public LoginForm $form;

public function render()
{
return view('livewire.pages.auth.login');
}

public function login(): void
{
$this->validate();

$this->form->authenticate();

Session::regenerate();

$this->redirectIntended(default: route('dashboard', absolute: false), navigate: true);
}
}
77 changes: 77 additions & 0 deletions app/Livewire/Auth/ResetPassword.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php

namespace App\Livewire\Auth;

use Illuminate\Auth\Events\PasswordReset;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Password;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Str;
use Illuminate\Validation\Rules;
use Livewire\Attributes\Locked;
use Livewire\Component;

class ResetPassword extends Component
{
#[Locked]
public string $token = '';
public string $email = '';
public string $password = '';
public string $password_confirmation = '';


public function render()
{
return view('livewire.pages.auth.reset-password');
}

/**
* Mount the component.
*/
public function mount(string $token): void
{
$this->token = $token;

$this->email = request()->string('email');
}

/**
* Reset the password for the given user.
*/
public function resetPassword(): void
{
$this->validate([
'token' => ['required'],
'email' => ['required', 'string', 'email'],
'password' => ['required', 'string', 'confirmed', Rules\Password::defaults()],
]);

// Here we will attempt to reset the user's password. If it is successful we
// will update the password on an actual user model and persist it to the
// database. Otherwise we will parse the error and return the response.
$status = Password::reset(
$this->only('email', 'password', 'password_confirmation', 'token'),
function ($user) {
$user->forceFill([
'password' => Hash::make($this->password),
'remember_token' => Str::random(60),
])->save();

event(new PasswordReset($user));
}
);

// If the password was successfully reset, we will redirect the user back to
// the application's home authenticated view. If there is an error we can
// redirect them back to where they came from with their error message.
if ($status != Password::PASSWORD_RESET) {
$this->addError('email', __($status));

return;
}

Session::flash('status', __($status));

$this->redirectRoute('login', navigate: true);
}
}
31 changes: 31 additions & 0 deletions app/Livewire/Navigation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace App\Livewire;

use App\Models\Asset;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Session;
use Livewire\Component;

class Navigation extends Component
{
public function render()
{
return view('navigation', [
'resume' => Asset::where('type_id', Asset::RESUME)->first()?->slug
]);
}

/**
* Log the current user out of the application.
*/
public function logout(): void
{
Auth::guard('web')->logout();

Session::invalidate();
Session::regenerateToken();

$this->redirect('/', navigate: true);
}
}
28 changes: 0 additions & 28 deletions app/Providers/VoltServiceProvider.php

This file was deleted.

1 change: 0 additions & 1 deletion bootstrap/providers.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@

return [
App\Providers\AppServiceProvider::class,
App\Providers\VoltServiceProvider::class,
];
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
"laravel/socialite": "^5.18",
"laravel/tinker": "^2.9",
"league/flysystem-aws-s3-v3": "^3.0",
"livewire/flux": "^2.0",
"livewire/flux-pro": "^2.0",
"livewire/livewire": "^3.4",
"livewire/volt": "^1.0",
"livewire/flux": "^2.10",
"livewire/flux-pro": "^2.10",
"livewire/livewire": "4.0",
"prezet/prezet": "^1.1",
"socialiteproviders/spotify": "^4.1",
"socialiteproviders/twitch": "^5.4",
Expand Down
Loading