mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 15:48:11 -05:00
Add logoutRedirectURL property to RootView, default to /, add exceptions
This commit is contained in:
parent
94cf5654ff
commit
53f8bca26b
7 changed files with 16 additions and 1 deletions
|
@ -51,7 +51,11 @@ module.exports.loginUser = (userObject, failure=genericFailure, nextURL=null) ->
|
|||
module.exports.logoutUser = ->
|
||||
FB?.logout?()
|
||||
callback = ->
|
||||
window.location = '/hoc'
|
||||
location = _.result(currentView, 'logoutRedirectURL')
|
||||
if location
|
||||
window.location = location
|
||||
else
|
||||
window.location.reload()
|
||||
res = $.post('/auth/logout', {}, callback)
|
||||
res.fail(genericFailure)
|
||||
|
||||
|
|
|
@ -4,3 +4,5 @@ template = require 'templates/about'
|
|||
module.exports = class AboutView extends RootView
|
||||
id: 'about-view'
|
||||
template: template
|
||||
|
||||
logoutRedirectURL: false
|
|
@ -17,3 +17,5 @@ module.exports = class CommunityView extends RootView
|
|||
|
||||
@$el.find('.logo-row img').each ->
|
||||
$(@).popover(placement: 'top', trigger: 'hover', container: 'body')
|
||||
|
||||
logoutRedirectURL: false
|
||||
|
|
|
@ -25,3 +25,5 @@ module.exports = class SalesView extends RootView
|
|||
onClickSignup: (e) ->
|
||||
@openModalView new AuthModal() if me.get('anonymous')
|
||||
window.tracker?.trackEvent 'Started Signup', category: 'Sales', label: 'Sales Create'
|
||||
|
||||
logoutRedirectURL: false
|
||||
|
|
|
@ -8,6 +8,7 @@ TrialRequest = require 'models/TrialRequest'
|
|||
module.exports = class TeachersFreeTrialView extends RootView
|
||||
id: 'teachers-free-trial-view'
|
||||
template: template
|
||||
logoutRedirectURL: false
|
||||
|
||||
events:
|
||||
'click .submit-button': 'onClickSubmit'
|
||||
|
|
|
@ -24,3 +24,5 @@ module.exports = class TeachersView extends RootView
|
|||
onClickSignup: (e) ->
|
||||
@openModalView new AuthModal() if me.get('anonymous')
|
||||
window.tracker?.trackEvent 'Started Signup', category: 'Teachers', label: 'Teachers Create'
|
||||
|
||||
logoutRedirectURL: false
|
||||
|
|
|
@ -171,3 +171,5 @@ module.exports = class RootView extends CocoView
|
|||
console.warn 'Error saving language:', errors
|
||||
res.success (model, response, options) ->
|
||||
#console.log 'Saved language:', newLang
|
||||
|
||||
logoutRedirectURL: '/'
|
Loading…
Reference in a new issue