[deploy] Redirect override (#9469)

This commit is contained in:
Fernando Valverde 2020-07-23 08:28:28 -06:00 committed by GitHub
parent 9bdef4d4ae
commit a9441add3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -178,7 +178,7 @@ class ChatChannelMembershipsController < ApplicationController
invite_cache_key = "chat-channel-invite-#{@chat_channel.id}"
invitation_slug = Rails.cache.read(invite_cache_key)
existing_membership = ChatChannelMembership.find_by(user_id: current_user.id, chat_channel_id: @chat_channel.id)
redirect_to connect_path(@chat_channel.slug) if existing_membership && existing_membership.status == "active"
redirect_to "/connect/#{@chat_channel.slug}" if existing_membership && existing_membership.status == "active"
@link_expired = true if invitation_slug != params[:invitation_slug]
end