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

forEach is not a function #149

Open
sbaleno opened this issue Dec 17, 2024 · 1 comment
Open

forEach is not a function #149

sbaleno opened this issue Dec 17, 2024 · 1 comment

Comments

@sbaleno
Copy link

sbaleno commented Dec 17, 2024

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch remix-auth-oauth2@3.2.0 for the project I'm working on.

Getting an error with the latest code change on URLSearchParams(cookie.get(name)).entries().forEach

Here is the diff that solved my problem:

diff --git a/node_modules/remix-auth-oauth2/build/lib/store.js b/node_modules/remix-auth-oauth2/build/lib/store.js
index d18d7e9..ee9e904 100644
--- a/node_modules/remix-auth-oauth2/build/lib/store.js
+++ b/node_modules/remix-auth-oauth2/build/lib/store.js
@@ -91,9 +91,9 @@ export class StateStore {
         for (let name of cookie.names()) {
             if (name.startsWith(cookieName)) {
                 // biome-ignore lint/complexity/noForEach: This is ok
-                new URLSearchParams(cookie.get(name))
-                    .entries()
-                    .forEach(([key, value]) => params.append(key, value));
+                for (const [key, value] of new URLSearchParams(cookie.get(name)).entries()) {
+                    params.append(key, value)
+                }
             }
         }
         return new StateStore(params);

This issue body was partially generated by patch-package.

@arabold
Copy link

arabold commented Dec 18, 2024

Running into the exact same problem. Thanks for the patch 🙏

biome-ignore lint/complexity/noForEach: This is ok

Oh, the irony 🤣

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

No branches or pull requests

2 participants