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
// I figured it out, here are the steps I took to solve this problem. For some reason, Stack Overflow isn't formatting my last 2 code blocks below. | |
// 1. store the url to return to in a cookie within the '.run()' method of `client/app/app.js` | |
.run(function ($rootScope, $location, Auth, $cookieStore) { | |
// Redirect to login if route requires auth and you're not logged in | |
$rootScope.$on('$stateChangeStart', function (event, next) { | |
Auth.isLoggedInAsync(function(loggedIn) { | |
if (next.authenticate && !loggedIn) { | |
// store the requested url if not logged in |