Added remember to url feature.
This commit is contained in:
parent
53ff165ba1
commit
ecea57baba
3 changed files with 13 additions and 1 deletions
|
@ -484,8 +484,13 @@ class App.Controller extends Spine.Controller
|
|||
|
||||
authenticate: ->
|
||||
console.log 'authenticate', window.Session
|
||||
|
||||
# return rtue if session exists
|
||||
return true if window.Session['id']
|
||||
|
||||
# remember requested url
|
||||
window.Config['requested_url'] = window.location.hash
|
||||
|
||||
# redirect to login
|
||||
@navigate '#login'
|
||||
return false
|
||||
|
|
|
@ -71,7 +71,13 @@ class Index extends App.Controller
|
|||
}
|
||||
|
||||
# redirect to #
|
||||
@navigate '#/'
|
||||
if window.Config['requested_url'] isnt ''
|
||||
@navigate window.Config['requested_url']
|
||||
|
||||
# reset
|
||||
window.Config['requested_url'] = ''
|
||||
else
|
||||
@navigate '#/'
|
||||
|
||||
error: (xhr, statusText, error) =>
|
||||
console.log 'login:error'
|
||||
|
|
|
@ -2,4 +2,5 @@ var Config = {};
|
|||
Config.Routes = {};
|
||||
Config.NavBar = {};
|
||||
Config.product_name = 'Zammad'
|
||||
Config.requested_url = ''
|
||||
var Session = {};
|
||||
|
|
Loading…
Reference in a new issue