Created
January 29, 2015 15:15
-
-
Save ctataryn/ff48723aca03644fab86 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajaxSetup({ | |
statusCode : { | |
//403 should mean they don't have a session, however if we | |
//throw 403s for more granular pressision checks, we'll want | |
//to do some further checking here to see if the session is | |
//indeed invalid before showing the session expiry dialog | |
//and bouncing them to the landing page | |
403: function() { | |
var route = container.lookup('route:application'); | |
var sessionController = container.lookup('controller:session'); | |
var modalController = container.lookup('controller:message-modal'); | |
modalController.set('onClose', function() { | |
//we know their session has expired, so update the UI | |
sessionController.send('loggedOut'); | |
}); | |
route.render('message-modal', { | |
into: 'application', | |
outlet: 'modal', | |
model: { | |
title: Ember.I18n.t('sessionTimeout.title'), | |
message: Ember.I18n.t('sessionTimeout') | |
} | |
}); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment