Do not remember #login and #logout as requested url.

This commit is contained in:
Martin Edenhofer 2015-03-03 10:14:57 +01:00
parent 9a1e2ca0f8
commit 43948e7bcc
8 changed files with 27 additions and 9 deletions

View file

@ -189,7 +189,10 @@ class App.Controller extends Spine.Controller
return true if @Session.get()
# remember requested url
@Config.set( 'requested_url', window.location.hash )
if !checkOnly
location = window.location.hash
if location isnt '#login' && location isnt '#logout'
@Config.set( 'requested_url', location)
return false if checkOnly

View file

@ -82,10 +82,12 @@ class App.SettingsAreaItem extends App.Controller
App.Event.trigger 'notify', {
type: 'success'
msg: App.i18n.translateContent('Update successful!')
timeout: 1500
timeout: 2000
}
ui.render()
#App.Event.trigger( 'ui:rerender' )
App.Event.trigger( 'ui:rerender' )
# login check
App.Auth.loginCheck()
)

View file

@ -92,7 +92,7 @@ class Index extends App.ControllerContent
# redirect to #
requested_url = @Config.get( 'requested_url' )
if requested_url && requested_url isnt '#login'
if requested_url && requested_url isnt '#login' && requested_url isnt '#logout'
@log 'notice', "REDIRECT to '#{requested_url}'"
@navigate requested_url

View file

@ -14,6 +14,6 @@ module Sso::Env
return user if user
end
return false
false
end
end

View file

@ -24,6 +24,6 @@ module Sso::Otrs
return
end
return user
user
end
end

View file

@ -11,6 +11,18 @@ class SettingTest < TestCase
)
tasks_close_all()
# make sure, that we have english frontend
click( :css => 'a[href="#current_user"]' )
click( :css => 'a[href="#profile"]' )
click( :css => 'a[href="#profile/language"]' )
select(
:css => '.language_item select[name="locale"]',
:value => 'English (United States)',
)
click( :css => '.content button[type="submit"]' )
sleep 2
# change settings
click( :css => 'a[href="#manage"]' )
click( :css => 'a[href="#settings/security"]' )
click( :css => 'a[href="#third_party_auth"]' )

View file

@ -125,8 +125,8 @@ class SignupPasswordChangeAndResetTest < TestCase
:value => 'Password changed successfully',
)
logout()
sleep 4
# check login with new pw
login(
:username => signup_user_email,
:password => 'some-pass-new2',

View file

@ -130,6 +130,7 @@ class TestCase < Test::Unit::TestCase
sleep 0.1
instance.find_elements( { :css => 'a[href="#logout"]' } )[0].click
(1..6).each {|loop|
sleep 1
login = instance.find_elements( { :css => '#login' } )[0]
if login
assert( true, "logout ok" )
@ -637,7 +638,7 @@ class TestCase < Test::Unit::TestCase
if params[:timeout]
timeout = params[:timeout]
end
loops = (timeout).to_i * 2
loops = (timeout).to_i
text = ''
(1..loops).each { |loop|
element = instance.find_elements( { :css => params[:css] } )[0]
@ -661,7 +662,7 @@ class TestCase < Test::Unit::TestCase
# just try again
end
end
sleep 0.5
sleep 1
}
raise "'#{params[:value]}' found in '#{text}'"
end