Too much recursion when attempting to logout (clear storage)
- 主要语言
- TypeScript
- 星标
- 8.1k
- 派生
- 1.5k
- PR 合并指标
- 30 天内没有已合并 PR
描述
I am using Nebular 7 (from ngx-admin),
when the session timed out, I try to relogin but get "InternalError: too much recursion" from login component.
( I use default login and I have been test with custom login component as well, I just follow the doc/guide)
Here is my code to logout:
```
this.authService.logout('email').subscribe(res => {
console.log(res);
localStorage.clear();
// this.nbTokenService.clear().subscribe(res => {
// }, error => {
// console.log(error);
// });
// this.router.navigate(['/auth/login']);
});
```
my app.module.ts
```
NbAuthModule.forRoot({
strategies: [
NbPasswordAuthStrategy.setup({
name: 'email',
baseEndpoint: 'https://localhost:5001',
token: {
class: NbAuthJWTToken,
key: 'token'
},
login: {
// ...
endpoint: '/api/Auth/login',
redirect: {
success: '/pages/dashboard',
failure: null, // stay on the same page
},
},
logout:{
redirect: {
success: '/auth/login',
failure: null, // stay on the same page
},
},
register: {
// ...
endpoint: '/api/Auth/register',
},
}),
```
I can logged in back if I delete the localstorage manually from the browser. I use latest Firefox 89.0.2 (64-bit) on windows 10.
current solutions:
just type localstorage.clear() and it works.
贡献指南
评估
这个 Issue 还没有评估数据。