generated from dxw/rails-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
overide authenticate_user! method for evaluation page redirection
- Loading branch information
1 parent
5d8f104
commit 84a5b46
Showing
2 changed files
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters