step up transition warning to red
refs #7166 test plan: * create user in a non-default account * login at the default account with that user * should get a red flash telling you to log in at the correct place Change-Id: I80805b5a08a96b67bc1193a4961aaf90c110eca9 Reviewed-on: https://gerrit.instructure.com/9181 Tested-by: Hudson <hudson@instructure.com> Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
This commit is contained in:
parent
5642e3a366
commit
70ca4d3f10
|
@ -133,7 +133,7 @@ class PseudonymSessionsController < ApplicationController
|
|||
# prefer a pseudonym from Site Admin if possible, otherwise just choose one
|
||||
valid_alternative = valid_alternatives.find {|p| p.account_id == Account.site_admin.id } || valid_alternatives.first
|
||||
if (!@domain_root_account.trusted_account_ids.include?(valid_alternative.account_id))
|
||||
flash[:notice] = t 'warnings.wrong_login_spot', "In the future, please login at %{domain}.", :domain => HostUrl.context_host(valid_alternative.account)
|
||||
flash[:error] = t 'warnings.wrong_login_spot', "In the future, please login at %{domain}.", :domain => HostUrl.context_host(valid_alternative.account)
|
||||
end
|
||||
@pseudonym_session = PseudonymSession.new(valid_alternative, params[:pseudonym_session][:remember_me] == "1")
|
||||
@pseudonym_session.save
|
||||
|
@ -360,7 +360,7 @@ class PseudonymSessionsController < ApplicationController
|
|||
|
||||
def successful_login(user, pseudonym)
|
||||
respond_to do |format|
|
||||
flash[:notice] ||= t 'notices.login_success', "Login successful."
|
||||
flash[:notice] = t 'notices.login_success', "Login successful." unless flash[:error]
|
||||
if session[:oauth2]
|
||||
# this is where we will verify client authorization and scopes, once implemented
|
||||
# .....
|
||||
|
|
|
@ -113,7 +113,8 @@ describe PseudonymSessionsController do
|
|||
HostUrl.expects(:context_host).with(account).returns('somewhere.else.com')
|
||||
post 'create', :pseudonym_session => { :unique_id => 'jt@instructure.com', :password => 'qwerty'}
|
||||
response.should redirect_to(dashboard_url(:login_success => 1))
|
||||
flash[:notice].should == 'In the future, please login at somewhere.else.com.'
|
||||
flash[:notice].should be_blank
|
||||
flash[:error].should == 'In the future, please login at somewhere.else.com.'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue