magic-builder 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magic-builder",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "CLI for Magic Builder — publish pages, functions, files, and performance reviews",
5
5
  "bin": {
6
6
  "magic-builder": "bin/magic-builder.js",
@@ -29,6 +29,7 @@ async function login(opts) {
29
29
  const requestId = String(data.request_id || '');
30
30
  const pollToken = String(data.poll_token || '');
31
31
  const authUrl = String(data.auth_url || '');
32
+ const pollUrl = String(data.poll_url || '').trim() || `${baseUrl}/api/dev-token/auth/token`;
32
33
  if (!requestId || !pollToken || !authUrl) {
33
34
  fail(`Invalid auth start response: ${JSON.stringify(start)}`, 'E_AUTH_FAILED', 2);
34
35
  }
@@ -45,7 +46,7 @@ async function login(opts) {
45
46
 
46
47
  const deadline = Date.now() + timeoutSeconds * 1000;
47
48
  while (Date.now() < deadline) {
48
- const tokenJson = await request(`${baseUrl}/api/dev-token/auth/token`, {
49
+ const tokenJson = await request(pollUrl, {
49
50
  method: 'POST',
50
51
  body: {
51
52
  request_id: requestId,