added created view and confirm show
CI/CD / test_and_check_app (push) Failing after 48s
CI/CD / Publish immutable image (push) Skipped

This commit is contained in:
2026-10-10 23:29:45 +02:00
parent 095ce60d8f
commit 8fadceabed
8 changed files with 151 additions and 33 deletions
+29 -5
View File
@@ -4,30 +4,54 @@ namespace App\Http\Controllers;
use App\Http\Requests\StoreOTSRequest;
use App\Models\OneTimeSecret;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Inertia\Inertia;
use Inertia\Response;
class OTSController extends Controller
{
public function created(Request $request)
{
$link = $request->session()->get('otsLink');
$request->session()->remove('otsLink');
if (! $link) {
return redirect()->route('ots.create');
}
return Inertia::render('ots/Created', [
'otsLink' => $link,
]);
}
public function store(StoreOTSRequest $request): RedirectResponse
{
$validated = $request->validated();
OneTimeSecret::create(($validated + ['expires_at' => now()->addMinutes(30)]));
$ots = OneTimeSecret::create(($validated + ['expires_at' => now()->addMinutes(30)]));
$otsLink = route('ots.show', ['oneTimeSecret' => $ots->id]);
return back();
return redirect()->route('ots.created')->with(['otsLink' => $otsLink]);
}
public function create(): Response
{
return Inertia::render('ots/Create');
return Inertia::render('ots/Create', []);
}
public function show(OneTimeSecret $oneTimeSecret): Response
{
$oneTimeSecret->delete();
return Inertia::render('ots/Show', ['oneTimeSecretId' => $oneTimeSecret->id]);
}
return Inertia::render('ots/Show', ['oneTimeSecret' => $oneTimeSecret]);
public function reveal(OneTimeSecret $oneTimeSecret): JsonResponse
{
$oneTimeSecret->delete();
if ($oneTimeSecret->expires_at->isPast()) {
abort(404);
}
return response()->json(['secret' => $oneTimeSecret->secret]);
}
}
+1 -1
View File
@@ -80,7 +80,7 @@ class TeamController extends Controller
public function create(): Response
{
return Inertia::render('team/Create');
return Inertia::render('team/Create', []);
}
/**