Commit 482b47ba authored by Yassine Doghri's avatar Yassine Doghri
Browse files

fix: redirect to non cached views when authenticated in public views

parent c1581c1f
Pipeline #1217 passed with stages
in 8 minutes and 22 seconds
......@@ -89,7 +89,10 @@ class EpisodeController extends BaseController
if (can_user_interact()) {
helper('form');
return view('episode/comments', $data);
}
// The page cache is set to a decade so it is deleted manually upon podcast update
return view('episode/comments', $data, [
'cache' => $secondsToNextUnpublishedEpisode
......@@ -128,6 +131,8 @@ class EpisodeController extends BaseController
if (can_user_interact()) {
helper('form');
return view('episode/activity', $data);
}
// The page cache is set to a decade so it is deleted manually upon podcast update
return view('episode/activity', $data, [
......
......@@ -88,6 +88,8 @@ class PodcastController extends BaseController
// if user is logged in then send to the authenticated activity view
if (can_user_interact()) {
helper('form');
return view('podcast/activity', $data);
}
$secondsToNextUnpublishedEpisode = (new EpisodeModel())->getSecondsToNextUnpublishedEpisode(
......@@ -136,6 +138,8 @@ class PodcastController extends BaseController
// // if user is logged in then send to the authenticated activity view
if (can_user_interact()) {
helper('form');
return view('podcast/about', $data);
}
$secondsToNextUnpublishedEpisode = (new EpisodeModel())->getSecondsToNextUnpublishedEpisode(
......@@ -257,6 +261,10 @@ class PodcastController extends BaseController
),
];
if (can_user_interact()) {
return view('podcast/episodes', $data);
}
$secondsToNextUnpublishedEpisode = (new EpisodeModel())->getSecondsToNextUnpublishedEpisode(
$this->podcast->id,
);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment