Handles 401 errors for OAuth users following the 'code flow' (redirects) and notifies the user if there is a fatal error. You wouldn't want the server giving your users 401s outright though -- only when the request is AJAX (X-Requested-With: XMLHttpRequest
.)
Uses jQuery (obviously) as well as Bootstrap modals. I'm not using PJAX just yet but I will include it when I do.
In the following example, I've placed the following elements as the last children of the <body>
element. Note the addition of the empty data-remote
attribute on #dynamic-modal
-- this prevents Bootstrap from performing a redundant load the first time the modal is used.
<div class="modal fade special" id="error-modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">