akveo / akveo/ngx-admin

NbPasswordAuthStrategy redirect not working

未关闭
#5,521 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
25.7k
派生
7.9k
PR 合并指标
30 天内没有已合并 PR

描述

Hello guys,

trying to implement the NbPasswordAuthStrategy. Here is my setup:

...NbAuthModule.forRoot({
strategies: [
NbPasswordAuthStrategy.setup({
name: 'email',
baseEndpoint: 'http://localhost:4000',
login: {
endpoint: '/login/',
method: 'get',
redirect: {
success: '/pages/dashboard',
failure: null,
},
},
})
],
forms: {
login: {}
},
}).providers,

Now when i receive a 200 status response from my endpoint, the app should redirect to 'pages/dashboard'. Actually the app is redirecting correctly but my Authguard redirects it back to login page since it thinks i am not authenticated:

.pipe(
tap(authenticated => {
if (!authenticated) {
console.log('not logged in -> redirect');
this.router.navigate(['auth/login']);
}
}),
);

Is there a bug with the NbPasswordAuthStrategy? Or am i missing something?

Any help would be very appreciated.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。