Backend login fails never appears in the UI
- 主要语言
- TypeScript
- 星标
- 8.1k
- 派生
- 1.5k
- PR 合并指标
- 30 天内没有已合并 PR
描述
### Issue type
**I'm submitting a ...** (check one with "x")
* [ x] bug report
* [ ] feature request
### Issue description
**Current behavior:**
When I enter a wrong password the backend returns 4XX which results in noting! no errors displayed
**Expected behavior:**
Show the error message
**Steps to reproduce:**
Just send 400 response from the login endpoint and see that the UI freezes.
**Related code:**
```
authenticate(data) {
const module = 'login';
const method = this.getOption(`${module}.method`);
const url = this.getActionEndpoint(module);
const requireValidToken = this.getOption(`${module}.requireValidToken`);
return this.http.request(method, url, { body: data, observe: 'response' })
.pipe(map((res) => {
if (this.getOption(`${module}.alwaysFail`)) {
throw this.createFailResponse(data);
}
return res;
}), map((res) => {
return new NbAuthResult(true, res, this.getOption(`${module}.redirect.success`), [], this.getOption('messages.getter')(module, res, this.options), this.createToken(this.getOption('token.getter')(module, res, this.options), requireValidToken));
}), catchError((res) => {
return this.handleResponseError(res, module);
}));
}
```
### Other information:
**npm, node, OS, Browser**
```
```
**Angular, Nebular**
```
```
贡献指南
评估
这个 Issue 还没有评估数据。