Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.userService.login(this.user)
- .subscribe(
- () => this.router.navigate(["/all"]),
- (error) => {
- alert("Unfortunately we could not find your account.");
- console.dump(error)
- }
- );
- login(user: User) {
- let headers = new Headers();
- headers.append("Content-Type", "application/x-www-form-urlencoded");
- headers.append("Accept", "application/json");
- let options = new RequestOptions({ headers: headers, withCredentials: true });
- let data = "j_username=" + user.username + "&" + "j_password=" + user.password;
- return this.http.post(Config.apiUrlS + "static/auth/j_spring_security_check", data, options);
- }
Add Comment
Please, Sign In to add comment