Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getToken() {
- return this.http.get(this.getServerUrl() + '/token');
- }
- login(username: string, password: string) {
- return this.getToken()
- .subscrive((response: Response) => {
- return this.http.post(this.getServerUrl() + '/login'
- , JSON.stringify({username: username, password: passowrd}))
- });
- }
- login(username, password) {
- event.preventDefault();
- this.authService.login(username, password)
- .subscribe(
- response => {
- console.log("success");
- },
- error => {
- console.log(error.text());
- }
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement