Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@Injectable()
export class AccountService {
constructor(
private http: Http) {
// This allows the cookie to be set and sent.
// It appears that once the cookie is set with login, it works for each call (even in other services)
let _build = (<any>http)._backend._browserXHR.build;
(<any>http)._backend._browserXHR.build = () => {
let _xhr = _build();
_xhr.withCredentials = true;
return _xhr;
};
}
// Other stuff
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.