Nebular Login not redirecting if already logged in
See original GitHub issueIssue type
I’m submitting a … (check one with “x”)
- bug report
- feature request
Issue description
Current behavior: Login component not redirecting if already logged in. For example, you log in, you get redirected to some page, then if you go by url to Login again, you can login again, even if you did not log out and so on (the token is also still there)
Expected behavior: Redirect to success redirect specified page if the user is authenticated
Steps to reproduce: Login, and navigate again to login page and you will be able to login as many times as you wish
Related code:
NbAuthModule.forRoot({
strategies: [
NbPasswordAuthStrategy.setup({
name: 'email',
token: {
class: NbAuthJWTToken,
key: 'my_token'
},
baseEndpoint: environment.connectCoreUri,
login: {
endpoint: 'api/login',
method: 'post',
redirect: {
success: 'auth/success',
failure: null,
},
}
}),
],
forms: {},
})
Other information:
npm, node, OS, Browser
Angular 6 all browsers
Angular, Nebular
Latest version of nebular
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
Nebular - Redirect after Login - GitHub Pages
Need some help or found an issue? Ask on Stack Overflow with tag `nebular` or post an issue on GitHub.
Read more >ngx-admin NbDummyAuthStrategy redirection after login
I have found that when using NbPasswordAuthStrategy you can easily set a redirect on successful login, however when using NbDummyAuthStrategy it ...
Read more >Configuring UI - Nebular
Auth module comes with a list of authentication components: ... delay before redirect after a successful login, while success message is shown to...
Read more >[NEBULA] Facebook Login — Zyxel Community
When an user have been facebook login and then reconnect again to wifi, ... logged out and disconnected, meaning users will not have...
Read more >Angular Authentication with OpenID Connect and Okta in 20 ...
Furthermore, when clicking the “Login” button on the home page, redirects straight to the callback component, without prompting a login page.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@iosif-bancioiu You can definitely solve this by doing a check in your
LoginComponent
.In my case, my
LoginComponent
is extending a class calledNbLoginComponent
. Thus, my check will be done inngOnInit
function. Here’s how I do it:Note that I don’t have to inject anything in the constructor because the parent class (NbLoginComponent) already have everything I need. Hope this helps.
@vikramsparamesh I found a workaround.