Skip to content

Commit

Permalink
Handle the case when the active session cache does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
danloa committed Dec 6, 2024
1 parent d381d18 commit 516c89e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ProcessMaker/Http/Middleware/VerifyActiveSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function handle(Request $request, Closure $next): Response
return response()->json(['error' => 'Unauthorized'], 401);
}
else {
$lastActivity = $activeSession['updated_at'];
$lastActivity = $activeSession ? $activeSession['updated_at'] : now();
// refresh the cache key lifetime
if (now()->diffInMinutes($lastActivity) > config('session.lifetime') / 2) {
Cache::put(
Expand Down

0 comments on commit 516c89e

Please sign in to comment.