Skip to content

Commit

Permalink
overide authenticate_user! method for evaluation page redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
edwin-jebaraj committed Jan 23, 2025
1 parent 5d8f104 commit 84a5b46
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions app/controllers/evaluation/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
module Evaluation
class ApplicationController < ::ApplicationController
protected

def authenticate_user!
return unless current_user.guest?

session.delete(:dfe_sign_in_uid)
if params[:controller] == "evaluation/tasks" && params[:action] == "edit"
session[:email_evaluator_link] = evaluation_task_path(id: params[:id], host: request.host)
end
redirect_to root_path, notice: I18n.t("banner.session.visitor")
end
end
end
2 changes: 1 addition & 1 deletion app/views/specify/home/_evaluation.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<p class="govuk-body">
<%= I18n.t("specifying.evaluation_page.watch_video") %>
<%= govuk_link_to I18n.t("specifying.evaluation_page.watch_video_link"), "https://www.youtube.com/watch?v=cbL65QlOas4", no_visited_state: true %>
<%= govuk_link_to I18n.t("specifying.evaluation_page.watch_video_link"), "https://www.youtube.com/watch?v=cbL65QlOas4", no_visited_state: true, target: "_blank" %>
</p>
<p class="govuk-body"><%= I18n.t("specifying.evaluation_page.evaluate_independently") %></p>
<p class="govuk-body"><%= I18n.t("specifying.evaluation_page.justification") %></p>
Expand Down

0 comments on commit 84a5b46

Please sign in to comment.