Fix auth translations and admin PWA UI
This commit is contained in:
@@ -47,6 +47,15 @@ class AuthenticatedSessionController extends Controller
|
||||
|
||||
$user = Auth::user();
|
||||
if ($user && $user->email_verified_at === null) {
|
||||
$intended = $request->session()->get('url.intended');
|
||||
$intended = is_string($intended) ? trim($intended) : null;
|
||||
|
||||
if ($this->isVerificationLink($intended)) {
|
||||
$request->session()->forget('url.intended');
|
||||
|
||||
return Inertia::location($intended);
|
||||
}
|
||||
|
||||
return Inertia::location(route('verification.notice'));
|
||||
}
|
||||
|
||||
@@ -116,6 +125,29 @@ class AuthenticatedSessionController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
private function isVerificationLink(?string $target): bool
|
||||
{
|
||||
if (! is_string($target) || trim($target) === '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
$path = trim($target);
|
||||
|
||||
if (str_starts_with($path, '/verify-email/')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$parsed = parse_url($path);
|
||||
|
||||
if ($parsed === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$path = $parsed['path'] ?? '';
|
||||
|
||||
return $path !== '' && str_starts_with($path, '/verify-email/');
|
||||
}
|
||||
|
||||
private function decodeReturnTo(string $value, Request $request): ?string
|
||||
{
|
||||
$candidate = $this->decodeBase64Url($value) ?? $value;
|
||||
|
||||
Reference in New Issue
Block a user