Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/core/src/lib/actions/signin/send-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ export async function sendToken(
(await provider.generateVerificationToken?.()) ?? randomString(32)

const ONE_DAY_IN_SECONDS = 86400
const expires = new Date(
Date.now() + (provider.maxAge ?? ONE_DAY_IN_SECONDS) * 1000
)
const maxAge =
provider.options?.maxAge ?? provider.maxAge ?? ONE_DAY_IN_SECONDS
const expires = new Date(Date.now() + maxAge * 1000)

const secret = provider.secret ?? options.secret

Expand Down
1 change: 1 addition & 0 deletions packages/core/src/providers/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export interface EmailConfig extends CommonProviderOptions {
type: "email"
name: string
from?: string
/** In seconds */
maxAge?: number
sendVerificationRequest: (
params: EmailProviderSendVerificationRequestParams
Expand Down