react-oauth2-pkce icon indicating copy to clipboard operation
react-oauth2-pkce copied to clipboard

💡 [REQUEST] - Add option to replace history instead of add to it

Open getsnoopy opened this issue 11 months ago • 2 comments

Summary

Currently, the logIn function, via the redirectToLogin function, always creates a new history entry because it uses window.location.assign. In some cases, we want to to be able to replace the history entry when redirecting to the login URL, so allowing this to be changed on a case-by-case basis would be nice.

Basic Example

Since it seems like the method parameter already exists, perhaps a new value for it can be used to accomplish this...something like replaced-redirect or ghost-redirect:

logIn('state', null, 'replaced-redirect');

Drawbacks

None.

Unresolved questions

No response

Implementation PR

No response

Reference Issues

No response

getsnoopy avatar Jan 26 '25 20:01 getsnoopy

@soofstad Ultimately your decision, but I can see this being something users could want.

@getsnoopy Would you try making a PR so we can see the idea in action? 😄

sebastianvitterso avatar Jan 27 '25 06:01 sebastianvitterso

Yeah we had this at one point. Considered it a bug and changed it 😄 But sure, we can make it configurable! I'd welcome a PR on this 👍

soofstad avatar Jan 27 '25 07:01 soofstad

Stale issue message

github-actions[bot] avatar Mar 28 '25 20:03 github-actions[bot]

Sounds good; I'll whip something up and push it

getsnoopy avatar Mar 30 '25 15:03 getsnoopy

Created it; please take a look

getsnoopy avatar Mar 30 '25 19:03 getsnoopy