Merge pull request #526 from metamaps/fix/invite-link

fix invite link
This commit is contained in:
Devin Howard 2016-04-01 13:37:33 +08:00
commit 7eb8ae37ee

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