Guest User

Untitled

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