summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Light <samlight1994@gmail.com>2025-09-11 15:39:23 +0100
committerSam Light <samlight1994@gmail.com>2025-09-11 15:39:23 +0100
commitb7d170e92f2b886b7413f9401e81d4d5dadbe2e6 (patch)
tree74f66b5fee2fc40ce112fc156d665d054d6b595c
parentbe7113db261341319311f474275b04c153e9c765 (diff)
Fixed bugs with auth caching
-rw-r--r--src/Controllers/ScormPlayerController.php1
-rw-r--r--src/Middleware/ScormPlayerAuthMiddleware.php6
2 files changed, 3 insertions, 4 deletions
diff --git a/src/Controllers/ScormPlayerController.php b/src/Controllers/ScormPlayerController.php
index 3243962..217b20b 100644
--- a/src/Controllers/ScormPlayerController.php
+++ b/src/Controllers/ScormPlayerController.php
@@ -10,7 +10,6 @@ use Lightscale\ScormPlayer\Models\{
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Storage;
-use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Str;
use Illuminate\Http\Request;
diff --git a/src/Middleware/ScormPlayerAuthMiddleware.php b/src/Middleware/ScormPlayerAuthMiddleware.php
index 0444f09..058a923 100644
--- a/src/Middleware/ScormPlayerAuthMiddleware.php
+++ b/src/Middleware/ScormPlayerAuthMiddleware.php
@@ -1,4 +1,4 @@
-<?php
+q<?php
namespace Lightscale\ScormPlayer\Middleware;
@@ -34,7 +34,7 @@ abstract class ScormPlayerAuthMiddleware
$user = $request->user();
$authorized = Cache::remember(
- 'scorm-player-authorize-{$user->id}_{$module->id}',
+ "scorm-player-authorize-{$user->id}_{$module->id}",
$this->cacheTimeout,
fn() => $this->authorize($request, $module)
);
@@ -45,7 +45,7 @@ abstract class ScormPlayerAuthMiddleware
protected function failedResponse() : Response
{
- return response('Not authorized', 503);
+ return response('Not authorized', 403);
}
protected function findModule(Request $request) : Scorm