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

authtoken option broken in v5 #308

Closed
icio opened this issue May 22, 2023 · 1 comment
Closed

authtoken option broken in v5 #308

icio opened this issue May 22, 2023 · 1 comment

Comments

@icio
Copy link

icio commented May 22, 2023

In #272 the call from connect to setAuthtoken was removed:

+/**
+ *
+ * @param {Object | string} opts
+ * @returns Promise<string>
+ */
 async function connect(opts) {
-  opts = defaults(opts);
-  validate(opts);
-  if (opts.authtoken) {
-    await setAuthtoken(opts);
-  }
+  const { tunnelOpts, globalOpts } = defaults(opts);
+  validate(globalOpts);
 
-  processUrl = await getProcess(opts);
+  processUrl = await getProcess(globalOpts);
   ngrokClient = new NgrokClient(processUrl);
-  return connectRetry(opts);
+  return connectRetry(tunnelOpts);
 }

b351812#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346L17-L19

Which has broken this documented way of connecting:

await ngrok.connect({authtoken: token, ...});

https://github.com/bubenshchykov/ngrok/#auth-token

@icio
Copy link
Author

icio commented May 22, 2023

Ah, no. It should be handled here, now:

if (opts.authtoken) start.push(`--authtoken=${opts.authtoken}`);

I've probably misdiagnosed my problem.

@icio icio closed this as completed May 22, 2023
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

1 participant