commit
7eb8ae37ee
1 changed files with 5 additions and 0 deletions
|
@ -5,6 +5,7 @@ class ApplicationController < ActionController::Base
|
|||
rescue_from Pundit::NotAuthorizedError, with: :handle_unauthorized
|
||||
protect_from_forgery
|
||||
|
||||
before_action :get_invite_link
|
||||
after_action :allow_embedding
|
||||
|
||||
def default_serializer_options
|
||||
|
@ -36,6 +37,10 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
private
|
||||
|
||||
def get_invite_link
|
||||
@invite_link = "#{request.base_url}/join" + (current_user ? "?code=#{current_user.code}" : "")
|
||||
end
|
||||
|
||||
def require_no_user
|
||||
if authenticated?
|
||||
redirect_to edit_user_path(user), notice: "You must be logged out."
|
||||
|
|
Loading…
Reference in a new issue