diff --git a/package.json b/package.json index 065a54b63..9b210e680 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "0.8.2", + "version": "0.8.3", "name": "@workos-inc/node", "author": "WorkOS", "description": "A Node wrapper for the WorkOS API", diff --git a/src/passwordless/passwordless.spec.ts b/src/passwordless/passwordless.spec.ts index b35721a9c..9189b6e4b 100644 --- a/src/passwordless/passwordless.spec.ts +++ b/src/passwordless/passwordless.spec.ts @@ -27,7 +27,7 @@ describe('Passwordless', () => { expect(session.object).toEqual('passwordless_session'); expect(JSON.parse(mock.history.post[0].data).email).toEqual(email); - expect(JSON.parse(mock.history.post[0].data).redirectURI).toEqual( + expect(JSON.parse(mock.history.post[0].data).redirect_uri).toEqual( redirectURI, ); expect(mock.history.post[0].url).toEqual('/passwordless/sessions'); diff --git a/src/passwordless/passwordless.ts b/src/passwordless/passwordless.ts index bbf4e2501..6f91e1dc4 100644 --- a/src/passwordless/passwordless.ts +++ b/src/passwordless/passwordless.ts @@ -6,10 +6,14 @@ import { SendSessionResponse } from './interfaces/send-session-response.interfac export class Passwordless { constructor(private readonly workos: WorkOS) {} - async createSession( - options: CreatePasswordlessSessionOptions, - ): Promise { - const { data } = await this.workos.post('/passwordless/sessions', options); + async createSession({ + redirectURI, + ...options + }: CreatePasswordlessSessionOptions): Promise { + const { data } = await this.workos.post('/passwordless/sessions', { + ...options, + redirect_uri: redirectURI, + }); return data; } diff --git a/src/sso/__snapshots__/sso.spec.ts.snap b/src/sso/__snapshots__/sso.spec.ts.snap index 160a6770f..14fe63f26 100644 --- a/src/sso/__snapshots__/sso.spec.ts.snap +++ b/src/sso/__snapshots__/sso.spec.ts.snap @@ -17,7 +17,7 @@ Object { "Accept": "application/json, text/plain, */*", "Authorization": "Bearer sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU", "Content-Type": "application/x-www-form-urlencoded;charset=utf-8", - "User-Agent": "workos-node/0.8.2", + "User-Agent": "workos-node/0.8.3", } `;