-
-
Save AlexDaSoul/7cdf7e51abc497c635de6cf1b49b17ca to your computer and use it in GitHub Desktop.
nga-31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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