I've found alot of text explaining this but i haven't quite found what i'm looking for. I'm hoping someone can point me in the right direction. I am building an Angular App that communicates with a RoR back-end. On the back-end there is a basic authentication with username and password. For the moment i've hardcoded the username and password into my app.js. I'm using Restangular so i set it up like so:
var authenticationToken = btoa('username,password');
.config(function (RestangularProvider) {
RestangularProvider.setDefaultHeaders({Authorization: 'Basic ' + authenticationToken});
}
But what I would like is for users to have to login when they open the app with username and password. So that my app can use those to send requests to the backend. I have no real idea how to set this up properly.
update I figured out my problem. I'm using default headers, while I should be using individual headers. Which i can just set in my service call.