Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Information for redirect for already logged user #263

Closed
Lele991 opened this issue Jun 3, 2019 · 2 comments
Closed

Information for redirect for already logged user #263

Lele991 opened this issue Jun 3, 2019 · 2 comments
Assignees
Labels

Comments

@Lele991
Copy link

Lele991 commented Jun 3, 2019

- [ ] bug report -> please search issues before submitting
- [x] feature request

Hi @AnthonyNahas, thanks for the library. I tried to find from the wiki the solution to create an autoredirect when the user is already logged in the site. For example:
When the new user connect to my website his view the page for login and after the successful login his is redirected to the dashboard, when this user try to reconnect to my website they show again the page for login but his is already logged.

It's possible to create this redirect to the dashboard when they insert the default link-address for already user logged? Thanks for the support :).

@AnthonyNahas AnthonyNahas self-assigned this Jul 1, 2019
@AnthonyNahas
Copy link
Owner

you need a similar mechanism like the authGuard...

for the meantime, you can implement by yourself a simple guard to enable redirection when the user is logged in... I will try to add this feature to the next release

@AnthonyNahas
Copy link
Owner

@Lele991 you can either implement that by yourself or use the loggedin guard from the library like below:

import {NgxAuthFirebaseUIModule} from 'ngx-auth-firebaseui';


  NgxAuthFirebaseUIModule.forRoot(firebaseKey, firebaseAppNameFactory,
      {
        authGuardFallbackURL: 'examples/logged-out',
        authGuardLoggedInURL: 'examples/logged-in',
      }),

in your routing module -->

{path: 'logged-in', component: LoggedInComponent},
{path: 'logged-out', component: LoggedOutComponent},
{path: 'guards', component: GuardsExampleComponent, canActivate : [LoggedInGuard]},

this available in v3.2.0

thank you 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants