Skip to content

Instantly share code, notes, and snippets.

@gdyrrahitis
Created August 18, 2018 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdyrrahitis/4f64d672aae313b65de75fbf9339b26c to your computer and use it in GitHub Desktop.
Save gdyrrahitis/4f64d672aae313b65de75fbf9339b26c to your computer and use it in GitHub Desktop.
ngSubmit() {
const username = this.form.get('username').value;
const password = this.form.get('password').value;
this.authService.authenticate(username, password).subscribe(() => {
const url = this.returnUrl || '/';
this.router.navigate([url]);
}, (error) => {
this.form.setErrors({
notAuthorized: true
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment