-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat(redirectUnauthorizedTo): allow passing query parameters #2287
Comments
Would allowing you to return your own |
I believe it would be, yes. For now, instead of using urls, i'm using: const redirectUnauthorizedToLogin = (route: ActivatedRouteSnapshot) => {
const path = route.pathFromRoot.map(v => v.url.map(segment => segment.toString()).join('/')).join('/');
const params = route.queryParams;
return pipe(
loggedIn,
tap((isLoggedIn) => {
if (!isLoggedIn) {
console.log('Saving afterLogin');
sessionStorage.setItem('afterLogin', JSON.stringify({path, params}));
}
}),
map(loggedIn => loggedIn || ['/'])
);
}; |
Isn't this issue a duplicate of #2144? Anyways, I'm currently attempting to introduce a fix for this issue by allowing the consumer to specify a |
EdricChan03
added a commit
to EdricChan03/angularfire
that referenced
this issue
May 9, 2020
…` to redirect to Closes angular#2287, angular#2144
EdricChan03
added a commit
to EdricChan03/angularfire
that referenced
this issue
May 9, 2020
…` to redirect to Closes angular#2287, angular#2144
EdricChan03
added a commit
to EdricChan03/angularfire
that referenced
this issue
May 9, 2020
EdricChan03
added a commit
to EdricChan03/angularfire
that referenced
this issue
May 23, 2020
EdricChan03
added a commit
to EdricChan03/angularfire
that referenced
this issue
Jun 15, 2020
@EdricChan03 any luck :) ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version info
Angular:
~9.0.0-rc.7
Firebase:
^7.6.1-0
AngularFire:
^5.3.0-rc.4
Using the
AngularFireAuthGuard
works, but does not support redirect with query parameters.When a user isn't authenticated, I'd like to direct them to login, and once they are logged in send them back to where they tried to access.
But I can't redirect to this url as its not a valid segment, and
redirectUnauthorizedTo
doesn't support query parametersThe text was updated successfully, but these errors were encountered: