Add fallback mechanism and logout button on 500 error page to prevent lock in change-password

This commit is contained in:
2026-08-01 23:02:12 +07:00
parent e06b1db44b
commit eda904524f
2 changed files with 24 additions and 6 deletions
+10 -2
View File
@@ -229,9 +229,17 @@ class UserController extends Controller
/**
* Show the change password form.
*/
public function changePasswordForm(): View
public function changePasswordForm()
{
return view('user.change_password');
try {
return view('user.change_password');
} catch (\Throwable $e) {
\Illuminate\Support\Facades\Log::error('Error rendering change_password view: ' . $e->getMessage());
return response()->view('errors.500', [
'exception' => $e,
'allowLogout' => true
], 500);
}
}
/**