From b7946a900a7f0f83f0df7feb73f6fbf028f846f1 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Wed, 2 Jun 2021 14:15:52 -0400 Subject: [PATCH] Add `expiresIn` to `CreatePasswordlessSessionOptions` (#405) --- .../create-passwordless-session-options.interface.ts | 3 ++- src/passwordless/passwordless.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/passwordless/interfaces/create-passwordless-session-options.interface.ts b/src/passwordless/interfaces/create-passwordless-session-options.interface.ts index ff8a65c4f..fa4a96bce 100644 --- a/src/passwordless/interfaces/create-passwordless-session-options.interface.ts +++ b/src/passwordless/interfaces/create-passwordless-session-options.interface.ts @@ -1,7 +1,8 @@ export interface CreatePasswordlessSessionOptions { + type: 'MagicLink'; email: string; redirectURI?: string; state?: string; connection?: string; - type: 'MagicLink'; + expiresIn?: number; } diff --git a/src/passwordless/passwordless.ts b/src/passwordless/passwordless.ts index 6f91e1dc4..c5f0b5b42 100644 --- a/src/passwordless/passwordless.ts +++ b/src/passwordless/passwordless.ts @@ -8,11 +8,13 @@ export class Passwordless { async createSession({ redirectURI, + expiresIn, ...options }: CreatePasswordlessSessionOptions): Promise { const { data } = await this.workos.post('/passwordless/sessions', { ...options, redirect_uri: redirectURI, + expires_in: expiresIn, }); return data; }