create-mastra 1.26.1-alpha.8 → 1.26.1
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/CHANGELOG.md +12 -0
- package/dist/{credentials-BwBqBx2B-BDWk6njZ.js → credentials-B4M5VuZS-BDWk6njZ.js} +1 -1
- package/dist/credentials-B4M5VuZS-BDWk6njZ.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/credentials-BwBqBx2B-BDWk6njZ.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials-B4M5VuZS-BDWk6njZ.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -533,7 +533,7 @@ async function authenticatedFetch(input, init) {
|
|
|
533
533
|
if (response.status !== 401 || !_currentToken) return response;
|
|
534
534
|
if (!_refreshInFlight) _refreshInFlight = (async () => {
|
|
535
535
|
try {
|
|
536
|
-
const { tryRefreshToken, loadCredentials } = await import('./credentials-
|
|
536
|
+
const { tryRefreshToken, loadCredentials } = await import('./credentials-B4M5VuZS-BDWk6njZ.js');
|
|
537
537
|
const creds = await loadCredentials();
|
|
538
538
|
if (!creds) throw new Error("No credentials");
|
|
539
539
|
const newToken2 = await tryRefreshToken(creds);
|
|
@@ -847,7 +847,7 @@ async function getToken(signal, options = {}) {
|
|
|
847
847
|
const creds = await loadCredentials();
|
|
848
848
|
signal?.throwIfAborted();
|
|
849
849
|
if (!creds) {
|
|
850
|
-
if (!isInteractive$1()) throw new Error("Not logged in. Run `mastra auth login` interactively or set MASTRA_API_TOKEN.");
|
|
850
|
+
if (options.allowLogin === false || !isInteractive$1()) throw new Error("Not logged in. Run `mastra auth login` interactively or set MASTRA_API_TOKEN.");
|
|
851
851
|
return (await login(signal, options)).token;
|
|
852
852
|
}
|
|
853
853
|
if (await verifyToken(creds.token, signal)) return creds.token;
|
|
@@ -855,7 +855,7 @@ async function getToken(signal, options = {}) {
|
|
|
855
855
|
const refreshed = await tryRefreshToken(creds, signal);
|
|
856
856
|
if (refreshed) return refreshed;
|
|
857
857
|
signal?.throwIfAborted();
|
|
858
|
-
if (!isInteractive$1()) throw new Error("Session expired. Run `mastra auth login` interactively or set MASTRA_API_TOKEN.");
|
|
858
|
+
if (options.allowLogin === false || !isInteractive$1()) throw new Error("Session expired. Run `mastra auth login` interactively or set MASTRA_API_TOKEN.");
|
|
859
859
|
return (await login(signal, options)).token;
|
|
860
860
|
}
|
|
861
861
|
|