Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. this.userService.login(this.user) .subscribe( () => this.router.navigate(["/all"]), (error) => {
  2. alert("Unfortunately we could not find your account.");
  3. console.dump(error)
  4. } );
  5.  
  6. login(user: User) {
  7. let headers = new Headers();
  8. headers.append("Content-Type", "application/x-www-form-urlencoded");
  9. headers.append("Accept", "application/json");
  10. let options = new RequestOptions({ headers: headers, withCredentials: true });
  11. let data = "j_username=" + user.username + "&" + "j_password=" + user.password;
  12. return this.http.post(Config.apiUrlS + "static/auth/j_spring_security_check", data, options);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement