better-auth-studio 1.0.45-beta.2 → 1.0.45-beta.4
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/README.md +20 -4
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +72 -0
- package/dist/routes.js.map +1 -1
- package/package.json +1 -1
- package/public/assets/{main-Bs_lgX45.js → main-B5vEtB6K.js} +11 -11
- package/public/index.html +1 -1
package/README.md
CHANGED
|
@@ -40,7 +40,13 @@ A sneak peek of the studio dashboard and management interface.
|
|
|
40
40
|
|
|
41
41
|
📖 **[Documentation](https://better-auth-studio.vercel.app)**
|
|
42
42
|
|
|
43
|
-
Install
|
|
43
|
+
**Recommended: Install as a dev dependency** (for project-specific versions):
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pnpm add -D better-auth-studio
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Or install globally using pnpm:
|
|
44
50
|
|
|
45
51
|
```bash
|
|
46
52
|
pnpm add -g better-auth-studio
|
|
@@ -60,6 +66,13 @@ pnpx better-auth-studio [cmd]
|
|
|
60
66
|
```
|
|
61
67
|
|
|
62
68
|
2. **Start the studio**
|
|
69
|
+
|
|
70
|
+
If installed as dev dependency:
|
|
71
|
+
```bash
|
|
72
|
+
pnpm better-auth-studio start
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Or with pnpx:
|
|
63
76
|
```bash
|
|
64
77
|
pnpx better-auth-studio start
|
|
65
78
|
```
|
|
@@ -177,14 +190,17 @@ pnpx better-auth-studio start [options]
|
|
|
177
190
|
|
|
178
191
|
**Examples:**
|
|
179
192
|
```bash
|
|
180
|
-
# Start on custom port
|
|
193
|
+
# Start on custom port (if installed as dev dependency)
|
|
194
|
+
pnpm better-auth-studio start --port 3001
|
|
195
|
+
|
|
196
|
+
# Or with pnpx
|
|
181
197
|
pnpx better-auth-studio start --port 3001
|
|
182
198
|
|
|
183
199
|
# Start without opening browser
|
|
184
|
-
|
|
200
|
+
pnpm better-auth-studio start --no-open
|
|
185
201
|
|
|
186
202
|
# Use custom config file
|
|
187
|
-
|
|
203
|
+
pnpm better-auth-studio start --config ./custom-auth.ts
|
|
188
204
|
```
|
|
189
205
|
|
|
190
206
|
### Other Commands
|
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAMA,OAAO,EAA+B,MAAM,EAAE,MAAM,SAAS,CAAC;AAS9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA8D9C,wBAAsB,oBAAoB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CA8I/E;AAwBD,wBAAgB,YAAY,CAC1B,UAAU,EAAE,UAAU,EACtB,UAAU,CAAC,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAMA,OAAO,EAA+B,MAAM,EAAE,MAAM,SAAS,CAAC;AAS9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA8D9C,wBAAsB,oBAAoB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CA8I/E;AAwBD,wBAAgB,YAAY,CAC1B,UAAU,EAAE,UAAU,EACtB,UAAU,CAAC,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAuqHR"}
|
package/dist/routes.js
CHANGED
|
@@ -1245,6 +1245,78 @@ export function createRoutes(authConfig, configPath, geoDbPath) {
|
|
|
1245
1245
|
});
|
|
1246
1246
|
}
|
|
1247
1247
|
});
|
|
1248
|
+
router.post('/api/tools/health-check', async (_req, res) => {
|
|
1249
|
+
try {
|
|
1250
|
+
const baseUrl = authConfig.baseURL?.replace(/\/$/, '') ||
|
|
1251
|
+
process.env.BETTER_AUTH_URL?.replace(/\/$/, '') ||
|
|
1252
|
+
'http://localhost:3000';
|
|
1253
|
+
const basePathRaw = authConfig.basePath || '/api/auth';
|
|
1254
|
+
const basePath = basePathRaw === '/' ? '' : basePathRaw.startsWith('/') ? basePathRaw : `/${basePathRaw}`;
|
|
1255
|
+
const endpointChecks = [
|
|
1256
|
+
{ label: 'Sign In', method: 'OPTIONS', path: '/sign-in/email' },
|
|
1257
|
+
{ label: 'Sign Up', method: 'OPTIONS', path: '/sign-up/email' },
|
|
1258
|
+
];
|
|
1259
|
+
const checks = await Promise.all(endpointChecks.map(async (check) => {
|
|
1260
|
+
const targetUrl = `${baseUrl}${basePath}${check.path}`;
|
|
1261
|
+
try {
|
|
1262
|
+
const response = await fetch(targetUrl, {
|
|
1263
|
+
method: check.method,
|
|
1264
|
+
});
|
|
1265
|
+
const ok = response.status < 500 && response.status !== 404 && response.status !== 302;
|
|
1266
|
+
if (!ok) {
|
|
1267
|
+
return {
|
|
1268
|
+
label: check.label,
|
|
1269
|
+
endpoint: check.path,
|
|
1270
|
+
ok: false,
|
|
1271
|
+
status: response.status,
|
|
1272
|
+
error: response.statusText,
|
|
1273
|
+
};
|
|
1274
|
+
}
|
|
1275
|
+
return {
|
|
1276
|
+
label: check.label,
|
|
1277
|
+
endpoint: check.path,
|
|
1278
|
+
ok,
|
|
1279
|
+
status: response.status,
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
catch (error) {
|
|
1283
|
+
return {
|
|
1284
|
+
label: check.label,
|
|
1285
|
+
endpoint: check.path,
|
|
1286
|
+
ok: false,
|
|
1287
|
+
status: null,
|
|
1288
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
1289
|
+
};
|
|
1290
|
+
}
|
|
1291
|
+
}));
|
|
1292
|
+
const allPassed = checks.every((check) => check.ok);
|
|
1293
|
+
const failedChecks = checks.filter((check) => !check.ok);
|
|
1294
|
+
if (allPassed) {
|
|
1295
|
+
res.json({
|
|
1296
|
+
success: true,
|
|
1297
|
+
message: 'All Better Auth endpoints are healthy',
|
|
1298
|
+
});
|
|
1299
|
+
}
|
|
1300
|
+
else {
|
|
1301
|
+
res.json({
|
|
1302
|
+
success: false,
|
|
1303
|
+
message: 'Some Better Auth endpoints failed health checks',
|
|
1304
|
+
failedEndpoints: failedChecks.map((check) => ({
|
|
1305
|
+
endpoint: check.endpoint,
|
|
1306
|
+
status: check.status,
|
|
1307
|
+
error: check.error,
|
|
1308
|
+
})),
|
|
1309
|
+
});
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
catch (error) {
|
|
1313
|
+
res.status(500).json({
|
|
1314
|
+
success: false,
|
|
1315
|
+
error: 'Health check failed',
|
|
1316
|
+
message: error instanceof Error ? error.message : 'Unknown error',
|
|
1317
|
+
});
|
|
1318
|
+
}
|
|
1319
|
+
});
|
|
1248
1320
|
// Database Detection endpoint - Auto-detect database from installed packages
|
|
1249
1321
|
router.get('/api/database/detect', async (_req, res) => {
|
|
1250
1322
|
try {
|