angularjs,authentication,angular-ui-router,satellizer
I found the answer in this Github Repo the idea is to have role based authentication as discussed in the Repo readme. so the code for forbidding the unauthorised access to /profile would be something like the following $stateProvider.state("profile", { url: "/profile", templateUrl: "app/profile/profile.html", controller: "ProfileCtrl", controllerAs: "user", data: {...
javascript,angularjs,protractor,jwt,satellizer
Working solution: browser.executeScript(function () { window.localStorage.satellizer_token = "eyJ0eXAiOiJKV1QiLCJhbGasdsOiJIUzI1NiJ9.eyJpZCI6IjE3MjUzIiwiaWF0IjoxNDM0Mzc1NjU3LCJleHAiOjE0NjU5Mjk2NTd9.VbhdWQ_gOb7X8pmOGLDjBKURQUQlcAfGSGvLRansQCphk"; }); ...
javascript,angularjs,node.js,authentication,satellizer
Okay, I changed the controllers in the API, and the app.js file in the frontend. So the problem was somewhere in one of those. I believe the real issue was in the backend logic though. I went for a major simplification... and it worked. Changed the register action to: register:...
angularjs,preflight,satellizer
After looking through the code and studying Angualr's httpProvider I realized that Sateliizer is intercepting every single request using httpProvider's interceptors array and adding the following: var token = localStorage.getItem(tokenName); if (token && config.httpInterceptor) { token = config.authHeader === 'Authorization' ? 'Bearer ' + token : token; httpConfig.headers[config.authHeader] = token;...
javascript,angularjs,satellizer
Usually provider objects can only be accessed at config time, whereas controllers are created in runtime. If you need to setup the authProvider, try doing: angular.module('PrayerChain').config( [ "$authProvider", function($authProvider) { $authProvider.loginRedirect = '/settings'; } ]).controller("loginCtrl", // ... ...
angularjs,controller,forms-authentication,oauth-provider,satellizer
Set in your config: $authProvider.baseUrl = null; ...