GRN-80: Allow local accounts on multitenant (#428)

* Changed the way the omniauth providers are declared

* Allow local authentication for multitenant mode based on customer settings

* Cleanead up code mandated by rubocop

* Completed implementation for signin and added the one for signup

* Fixed issue with rubocop

* Renamed customer_name to lb_user

* Renamed lb_user -> user_domain, fixed issue with signup controller, email verification WAS NOT implemented

* Completed implementation of email_verification

* Fixed rubocop issue

* Final update

* Fix for test with loadbalancer

* Make sure loadbalancer mockup is only used when env defined

* Fix for test on rooms_controller

* Fixed most of the test failing on multitenant env

* Fixed issue detected by rubocop

* Fixed issue with activation tockens not working on resend

* Fixed new issue found by rubocop

* Updated travis script

* Harcoded credentials for mockup

* Updated expectation on start_session

* Fixed issue with duplication of home room

* Updated script for rubocop

* Restored Gemfile
This commit is contained in:
Jesus Federico
2019-04-05 14:54:36 -04:00
committed by GitHub
parent 5ba5b663ac
commit b15868fb3c
28 changed files with 354 additions and 293 deletions

View File

@ -27,7 +27,7 @@ class AccountActivationsController < ApplicationController
# GET /account_activations/edit
def edit
if @user && !@user.email_verified? && @user.authenticated?(:activation, params[:token])
if @user && !@user.activated? && @user.authenticated?(:activation, params[:token])
@user.activate
flash[:success] = I18n.t("verify.activated") + " " + I18n.t("verify.signin")
@ -40,7 +40,7 @@ class AccountActivationsController < ApplicationController
# GET /account_activations/resend
def resend
if @user.email_verified
if @user.activated?
flash[:alert] = I18n.t("verify.already_verified")
else
begin
@ -67,10 +67,10 @@ class AccountActivationsController < ApplicationController
end
def email_params
params.require(:email).permit(:token)
params.require(:email).permit(:email, :token)
end
def find_user
@user = User.find_by!(email: params[:email], provider: "greenlight")
@user = User.find_by!(email: params[:email], provider: @user_domain)
end
end