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

[BUG] Query params are duplicated after redirect #35

Closed
1 task done
ms-emp opened this issue Oct 12, 2023 · 8 comments
Closed
1 task done

[BUG] Query params are duplicated after redirect #35

ms-emp opened this issue Oct 12, 2023 · 8 comments
Assignees
Labels
bug Something isn't working needs triage

Comments

@ms-emp
Copy link
Contributor

ms-emp commented Oct 12, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Library version

3.0.0-alpha.1

Description

When the user navigates to a protected page and includes some query parameters, the query parameters are duplicated when he comes back to the app after logging in.

Steps to reproduce

See this test app, clone, run, log in using credentials from here, click on Logout, then click on Page 2 with params and see the output on the page.

Environment

  • Angular version: 16
@ms-emp ms-emp added bug Something isn't working needs triage labels Oct 12, 2023
@ms-emp
Copy link
Contributor Author

ms-emp commented Oct 18, 2023

So I found the bug.

In AuthService line 167 absUrl already contains the query string so we shouldn't append value.search.

image

@Badisi
Copy link
Owner

Badisi commented Oct 18, 2023

Thanks for the investigation !
I'll try to find some time in the upcoming days to have a look into it.

@Badisi Badisi self-assigned this Oct 18, 2023
@ms-emp
Copy link
Contributor Author

ms-emp commented Nov 7, 2023

Hi,

I created a fix branch, but I'm getting a 403 when I try to push the branch to GitHub?!

Also, how can I fork the source code for version 3.0.0-alpha.1?

@ms-emp
Copy link
Contributor Author

ms-emp commented Feb 9, 2024

@Badisi

Can you please review this PR? #36

@Badisi
Copy link
Owner

Badisi commented Feb 12, 2024

I've been really busy these past few months and I haven't had any time to dedicate to this library, unfortunately..
I'll do my best to get everything sorted out this week.
Thanks for the PR, and sorry for the inconvenience.

@Badisi Badisi changed the title [BUG] Incorrect redirect after login [BUG] Query params are duplicated after redirect Feb 21, 2024
@Badisi
Copy link
Owner

Badisi commented Feb 21, 2024

Issue must have been introduced after Angular 14 (because I can reproduce it with Angular 16 but not Angular 14).

URL.href is returning the whole url anyway, so there is definitely no need to add search params.

Fix will be available in the next release.

@Badisi Badisi closed this as completed in 5c2b108 Feb 21, 2024
Badisi pushed a commit that referenced this issue Feb 22, 2024
@Badisi
Copy link
Owner

Badisi commented Feb 22, 2024

Also, the Angular demo app now has a query params settings to play with:
https://badisi.github.io/auth-js/demo-app/ngx-auth

@Badisi
Copy link
Owner

Badisi commented Mar 7, 2024

🎉 Released in @badisi/[email protected] 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants