mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2025-12-13 23:56:47 +00:00
63 lines
1.8 KiB
PHP
63 lines
1.8 KiB
PHP
<?php
|
|
|
|
use App\Traits\SeoTrait;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Validation\ValidationException;
|
|
use Livewire\Attributes\Layout;
|
|
use Livewire\Volt\Component;
|
|
|
|
new #[Layout('components.layouts.auth')]
|
|
class extends Component {
|
|
use SeoTrait;
|
|
|
|
public string $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', ['country' => str(session('lang_country', 'de'))->after('-')->lower()], absolute: false), navigate: true);
|
|
}
|
|
}; ?>
|
|
|
|
<div class="flex flex-col gap-6">
|
|
<x-auth-header
|
|
:title="__('Confirm password')"
|
|
:description="__('This is a secure area of the application. Please confirm your password before continuing.')"
|
|
/>
|
|
|
|
<!-- Session Status -->
|
|
<x-auth-session-status class="text-center" :status="session('status')"/>
|
|
|
|
<form wire:submit="confirmPassword" class="flex flex-col gap-6">
|
|
<!-- Password -->
|
|
<flux:input
|
|
wire:model="password"
|
|
:label="__('Password')"
|
|
type="password"
|
|
required
|
|
autocomplete="new-password"
|
|
:placeholder="__('Password')"
|
|
viewable
|
|
/>
|
|
|
|
<flux:button variant="primary" type="submit" class="w-full">{{ __('Confirm') }}</flux:button>
|
|
</form>
|
|
</div>
|