akveo / akveo/ngx-admin

NbPasswordAuthStrategy redirect not working

Đang mở
#5,521 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
25.7k
Fork
7.9k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.