Add diagnostics to error page and admin dashboard

This commit is contained in:
Daniel Supernault 2021-07-01 21:46:45 -06:00
parent 2a38201acb
commit 64725ecce7
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
5 changed files with 190 additions and 3 deletions

View file

@ -440,4 +440,29 @@ class AdminController extends Controller
$redirect = $news->published_at ? $news->permalink() : $news->editUrl();
return redirect($redirect);
}
public function diagnosticsHome(Request $request)
{
return view('admin.diagnostics.home');
}
public function diagnosticsDecrypt(Request $request)
{
$this->validate($request, [
'payload' => 'required'
]);
$key = 'exception_report:';
$decrypted = decrypt($request->input('payload'));
if(!starts_with($decrypted, $key)) {
abort(403, 'Can only decrypt error diagnostics');
}
$res = [
'decrypted' => substr($decrypted, strlen($key))
];
return response()->json($res);
}
}