Skip to content

Commit

Permalink
Show privacy notice before redirecting if not signed
Browse files Browse the repository at this point in the history
  • Loading branch information
mwvolo committed Nov 17, 2023
1 parent e0596cb commit 7409db4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/controllers/newflow/login_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class LoginController < BaseController
before_action :known_signup_role_redirect, only: :login_form
before_action :cache_alternate_signup_url, only: :login_form
before_action :redirect_to_signup_if_go_param_present, only: :login_form
before_action :did_sign_privacy_notice, only: :login_form
before_action :redirect_back, if: -> { signed_in? }, only: :login_form

def login
Expand Down Expand Up @@ -86,5 +87,12 @@ def should_redirect_to_signup_welcome?
def cache_alternate_signup_url
set_alternate_signup_url(params[:signup_at])
end

def did_sign_privacy_notice
contract = FinePrint.get_contract(:privacy_policy)
unless contract.signed_by?(current_user)
redirect_to pose_term_url(name: contract.name, params: request.params)
end
end
end
end

0 comments on commit 7409db4

Please sign in to comment.