better-auth-studio 1.0.59-beta.13 → 1.0.59-beta.14
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/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +34 -9
- package/dist/routes.js.map +1 -1
- package/package.json +1 -1
- package/public/assets/{main-sbtbb6Py.js → main-CwFJsdfr.js} +102 -135
- package/public/index.html +1 -1
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAeA,OAAO,EAA+B,MAAM,EAAE,MAAM,SAAS,CAAC;AAS9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA+D9C,wBAAsB,oBAAoB,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAqLhG;AAeD,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":"AAeA,OAAO,EAA+B,MAAM,EAAE,MAAM,SAAS,CAAC;AAS9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA+D9C,wBAAsB,oBAAoB,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAqLhG;AAeD,wBAAgB,YAAY,CAC1B,UAAU,EAAE,UAAU,EACtB,UAAU,CAAC,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAkzLR"}
|
package/dist/routes.js
CHANGED
|
@@ -5122,14 +5122,11 @@ export const authClient = createAuthClient({
|
|
|
5122
5122
|
}
|
|
5123
5123
|
const envPath = join(process.cwd(), '.env');
|
|
5124
5124
|
const envLocalPath = join(process.cwd(), '.env.local');
|
|
5125
|
-
// Try .env.local first, then .env
|
|
5126
5125
|
const targetPath = existsSync(envLocalPath) ? envLocalPath : envPath;
|
|
5127
5126
|
const envContent = existsSync(targetPath) ? readFileSync(targetPath, 'utf-8') : '';
|
|
5128
|
-
// Generate environment variable names
|
|
5129
5127
|
const providerUpper = provider.toUpperCase();
|
|
5130
5128
|
const clientIdKey = `${providerUpper}_CLIENT_ID`;
|
|
5131
5129
|
const clientSecretKey = `${providerUpper}_CLIENT_SECRET`;
|
|
5132
|
-
// Parse existing .env file
|
|
5133
5130
|
const envLines = envContent.split('\n');
|
|
5134
5131
|
const existingCredentials = {};
|
|
5135
5132
|
envLines.forEach((line) => {
|
|
@@ -5325,30 +5322,58 @@ export const authClient = createAuthClient({
|
|
|
5325
5322
|
'password-reset': {
|
|
5326
5323
|
regex: /sendResetPassword\s*:\s*async\s*\([^)]*\)\s*=>\s*\{[\s\S]*?\},?/,
|
|
5327
5324
|
fn: `sendResetPassword: async ({ user, url, token }, request) => {
|
|
5325
|
+
const subject = \\\`${escapedSubject}\\\`
|
|
5326
|
+
.replace(/{{user.name}}/g, user?.name || '')
|
|
5327
|
+
.replace(/{{user.email}}/g, user?.email || '');
|
|
5328
|
+
|
|
5329
|
+
const html = \\\`${escapedHtml}\\\`
|
|
5330
|
+
.replace(/{{user.name}}/g, user?.name || '')
|
|
5331
|
+
.replace(/{{user.email}}/g, user?.email || '')
|
|
5332
|
+
.replace(/{{url}}/g, url || '')
|
|
5333
|
+
.replace(/{{token}}/g, token || '');
|
|
5334
|
+
|
|
5328
5335
|
void sendEmail({
|
|
5329
5336
|
to: user.email,
|
|
5330
|
-
subject
|
|
5331
|
-
|
|
5337
|
+
subject,
|
|
5338
|
+
html,
|
|
5332
5339
|
});
|
|
5333
5340
|
}`,
|
|
5334
5341
|
},
|
|
5335
5342
|
'email-verification': {
|
|
5336
5343
|
regex: /sendVerificationEmail\s*:\s*async\s*\([^)]*\)\s*=>\s*\{[\s\S]*?\},?/,
|
|
5337
5344
|
fn: `sendVerificationEmail: async ({ user, url, token }, request) => {
|
|
5345
|
+
const subject = \\\`${escapedSubject}\\\`
|
|
5346
|
+
.replace(/{{user.name}}/g, user?.name || '')
|
|
5347
|
+
.replace(/{{user.email}}/g, user?.email || '');
|
|
5348
|
+
|
|
5349
|
+
const html = \\\`${escapedHtml}\\\`
|
|
5350
|
+
.replace(/{{user.name}}/g, user?.name || '')
|
|
5351
|
+
.replace(/{{user.email}}/g, user?.email || '')
|
|
5352
|
+
.replace(/{{url}}/g, url || '')
|
|
5353
|
+
.replace(/{{token}}/g, token || '');
|
|
5354
|
+
|
|
5338
5355
|
void sendEmail({
|
|
5339
5356
|
to: user.email,
|
|
5340
|
-
subject
|
|
5341
|
-
|
|
5357
|
+
subject,
|
|
5358
|
+
html,
|
|
5342
5359
|
});
|
|
5343
5360
|
}`,
|
|
5344
5361
|
},
|
|
5345
5362
|
'magic-link': {
|
|
5346
5363
|
regex: /sendMagicLink\s*:\s*async\s*\([^)]*\)\s*=>\s*\{[\s\S]*?\},?/,
|
|
5347
5364
|
fn: `sendMagicLink: async ({ email, token, url }, ctx) => {
|
|
5365
|
+
const subject = \\\`${escapedSubject}\\\`
|
|
5366
|
+
.replace(/{{user.email}}/g, email || '');
|
|
5367
|
+
|
|
5368
|
+
const html = \\\`${escapedHtml}\\\`
|
|
5369
|
+
.replace(/{{user.email}}/g, email || '')
|
|
5370
|
+
.replace(/{{url}}/g, url || '')
|
|
5371
|
+
.replace(/{{token}}/g, token || '');
|
|
5372
|
+
|
|
5348
5373
|
void sendEmail({
|
|
5349
5374
|
to: email,
|
|
5350
|
-
subject
|
|
5351
|
-
|
|
5375
|
+
subject,
|
|
5376
|
+
html,
|
|
5352
5377
|
});
|
|
5353
5378
|
}`,
|
|
5354
5379
|
},
|