fix invite link

This commit is contained in:
Devin Howard 2016-03-29 22:34:47 +08:00
parent c1aa7c6a92
commit a2fe1399e4

View file

@ -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."