mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-10 23:48:09 -05:00
feat[auth]: when no resend key is provided for emails, log instead
This commit is contained in:
@@ -6,7 +6,8 @@ BETTER_AUTH_SECRET=your_secret_key # Use `openssl rand -hex 32` to generate, or
|
||||
BETTER_AUTH_URL=http://localhost:3000
|
||||
|
||||
# Email Provider (Optional)
|
||||
RESEND_API_KEY=your_resend_api_key # Get from https://resend.com
|
||||
# RESEND_API_KEY= # Uncomment and add your key from https://resend.com to send actual emails
|
||||
# If left commented out, emails will be logged to console instead
|
||||
|
||||
# App URL (Required)
|
||||
NEXT_PUBLIC_APP_URL=http://localhost:3000
|
||||
|
||||
@@ -12,13 +12,14 @@ const logger = createLogger('Auth')
|
||||
|
||||
// If there is no resend key, it might be a local dev environment
|
||||
// In that case, we don't want to send emails and just log them
|
||||
const resend = process.env.RESEND_API_KEY
|
||||
? new Resend(process.env.RESEND_API_KEY)
|
||||
: {
|
||||
emails: {
|
||||
send: async (...args: any[]) => logger.info('Email sent:', args),
|
||||
},
|
||||
}
|
||||
const resend =
|
||||
process.env.RESEND_API_KEY && process.env.RESEND_API_KEY.trim() !== ''
|
||||
? new Resend(process.env.RESEND_API_KEY)
|
||||
: {
|
||||
emails: {
|
||||
send: async (...args: any[]) => logger.info('Email sent:', args),
|
||||
},
|
||||
}
|
||||
|
||||
export const auth = betterAuth({
|
||||
database: drizzleAdapter(db, {
|
||||
|
||||
Reference in New Issue
Block a user