Skip to content

Instantly share code, notes, and snippets.

@AlexDaSoul
Created January 19, 2020 15:26
Show Gist options
  • Save AlexDaSoul/7cdf7e51abc497c635de6cf1b49b17ca to your computer and use it in GitHub Desktop.
Save AlexDaSoul/7cdf7e51abc497c635de6cf1b49b17ca to your computer and use it in GitHub Desktop.
nga-31
public onSubmit(): void {
if (this.form.valid) {
this.authGrpcService.auth(this.form.value)
.subscribe(
res => {
this.authService.loggedIn(res.token);
this.form.reset();
this.router.navigateByUrl('/chat');
},
err => {
const message = err.code === 13 ? 'User not found' : err.message;
this.snackBar.open(message, 'close', {
duration: 5000,
horizontalPosition: 'right',
verticalPosition: 'top',
panelClass: 'error-message',
});
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment