fix: bypass tenant scope in AttemptController::show - candidates (no tenant_id) were getting 404 on quiz start
This commit is contained in:
@@ -48,8 +48,12 @@ class AttemptController extends Controller
|
||||
abort(403);
|
||||
}
|
||||
}
|
||||
public function show(Quiz $quiz)
|
||||
public function show(int $quizId)
|
||||
{
|
||||
// Bypass tenant global scope: candidates have no tenant_id
|
||||
// but should still access their assigned quizzes
|
||||
$quiz = Quiz::withoutGlobalScopes()->findOrFail($quizId);
|
||||
|
||||
$candidate = auth()->user()->candidate;
|
||||
|
||||
if (!$candidate) {
|
||||
|
||||
Reference in New Issue
Block a user