From 88a7c49840eda08ddab9fdcdb35ba335089981bb Mon Sep 17 00:00:00 2001 From: KunalOfficial <35455566+developerkunal@users.noreply.github.com> Date: Tue, 27 Aug 2024 12:24:36 +0530 Subject: [PATCH] Add support for `login-passwordless` prompt on `Prompt Partials` in Prompts Handler (#946) * Added support for login-passwordless prompt on prompt partials * Added Testcases for Prompts --- src/tools/auth0/handlers/prompts.ts | 3 +++ ...leting-resources-if-AUTH0_ALLOW_DELETE-is-true.json | 10 ++++++++++ ...eting-resources-if-AUTH0_ALLOW_DELETE-is-false.json | 10 ++++++++++ ...ould-dump-and-deploy-without-throwing-an-error.json | 10 ++++++++++ .../should-dump-without-throwing-an-error.json | 10 ++++++++++ test/tools/auth0/handlers/prompts.tests.ts | 2 ++ 6 files changed, 45 insertions(+) diff --git a/src/tools/auth0/handlers/prompts.ts b/src/tools/auth0/handlers/prompts.ts index 9c56ba1d6..c466da39c 100644 --- a/src/tools/auth0/handlers/prompts.ts +++ b/src/tools/auth0/handlers/prompts.ts @@ -98,6 +98,7 @@ const customPartialsPromptTypes = [ 'login', 'login-id', 'login-password', + 'login-passwordless', 'signup', 'signup-id', 'signup-password', @@ -112,6 +113,8 @@ const customPartialsScreenTypes = [ 'signup', 'signup-id', 'signup-password', + 'login-passwordless-sms-otp', + 'login-passwordless-email-code' ] as const; export type CustomPartialsScreenTypes = typeof customPartialsPromptTypes[number]; diff --git a/test/e2e/recordings/should-deploy-while-deleting-resources-if-AUTH0_ALLOW_DELETE-is-true.json b/test/e2e/recordings/should-deploy-while-deleting-resources-if-AUTH0_ALLOW_DELETE-is-true.json index 82a4a8d93..a308904e3 100644 --- a/test/e2e/recordings/should-deploy-while-deleting-resources-if-AUTH0_ALLOW_DELETE-is-true.json +++ b/test/e2e/recordings/should-deploy-while-deleting-resources-if-AUTH0_ALLOW_DELETE-is-true.json @@ -11279,6 +11279,16 @@ "rawHeaders": [], "responseIsBinary": false }, + { + "scope": "https://deploy-cli-dev.eu.auth0.com:443", + "method": "GET", + "path": "/api/v2/prompts/login-passwordless/partials", + "body": "", + "status": 200, + "response": {}, + "rawHeaders": [], + "responseIsBinary": false + }, { "scope": "https://deploy-cli-dev.eu.auth0.com:443", "method": "GET", diff --git a/test/e2e/recordings/should-deploy-without-deleting-resources-if-AUTH0_ALLOW_DELETE-is-false.json b/test/e2e/recordings/should-deploy-without-deleting-resources-if-AUTH0_ALLOW_DELETE-is-false.json index 79b5a8023..09b7bc41b 100644 --- a/test/e2e/recordings/should-deploy-without-deleting-resources-if-AUTH0_ALLOW_DELETE-is-false.json +++ b/test/e2e/recordings/should-deploy-without-deleting-resources-if-AUTH0_ALLOW_DELETE-is-false.json @@ -12778,6 +12778,16 @@ "rawHeaders": [], "responseIsBinary": false }, + { + "scope": "https://deploy-cli-dev.eu.auth0.com:443", + "method": "GET", + "path": "/api/v2/prompts/login-passwordless/partials", + "body": "", + "status": 200, + "response": {}, + "rawHeaders": [], + "responseIsBinary": false + }, { "scope": "https://deploy-cli-dev.eu.auth0.com:443", "method": "GET", diff --git a/test/e2e/recordings/should-dump-and-deploy-without-throwing-an-error.json b/test/e2e/recordings/should-dump-and-deploy-without-throwing-an-error.json index 724c9a67f..bad08b842 100644 --- a/test/e2e/recordings/should-dump-and-deploy-without-throwing-an-error.json +++ b/test/e2e/recordings/should-dump-and-deploy-without-throwing-an-error.json @@ -1752,6 +1752,16 @@ "rawHeaders": [], "responseIsBinary": false }, + { + "scope": "https://deploy-cli-dev.eu.auth0.com:443", + "method": "GET", + "path": "/api/v2/prompts/login-passwordless/partials", + "body": "", + "status": 200, + "response": {}, + "rawHeaders": [], + "responseIsBinary": false + }, { "scope": "https://deploy-cli-dev.eu.auth0.com:443", "method": "GET", diff --git a/test/e2e/recordings/should-dump-without-throwing-an-error.json b/test/e2e/recordings/should-dump-without-throwing-an-error.json index 30682a7d5..9d454f284 100644 --- a/test/e2e/recordings/should-dump-without-throwing-an-error.json +++ b/test/e2e/recordings/should-dump-without-throwing-an-error.json @@ -1710,6 +1710,16 @@ "rawHeaders": [], "responseIsBinary": false }, + { + "scope": "https://deploy-cli-dev.eu.auth0.com:443", + "method": "GET", + "path": "/api/v2/prompts/login-passwordless/partials", + "body": "", + "status": 200, + "response": {}, + "rawHeaders": [], + "responseIsBinary": false + }, { "scope": "https://deploy-cli-dev.eu.auth0.com:443", "method": "GET", diff --git a/test/tools/auth0/handlers/prompts.tests.ts b/test/tools/auth0/handlers/prompts.tests.ts index bd225c334..a772c794d 100644 --- a/test/tools/auth0/handlers/prompts.tests.ts +++ b/test/tools/auth0/handlers/prompts.tests.ts @@ -105,6 +105,7 @@ describe('#prompts handler', () => { getCustomPartial.withArgs({ prompt: 'login' }).resolves(loginPartial); getCustomPartial.withArgs({ prompt: 'login-id' }).resolves({}); getCustomPartial.withArgs({ prompt: 'login-password' }).resolves({}); + getCustomPartial.withArgs({ prompt: 'login-passwordless' }).resolves({}); getCustomPartial.withArgs({ prompt: 'signup-password' }).resolves({}); getCustomPartial.withArgs({ prompt: 'signup-id' }).resolves({}); getCustomPartial.withArgs({ prompt: 'signup' }).resolves(signupPartial); @@ -293,6 +294,7 @@ describe('#prompts handler', () => { getCustomPartial.withArgs({ prompt: 'login' }).resolves({}); getCustomPartial.withArgs({ prompt: 'login-id' }).resolves({}); getCustomPartial.withArgs({ prompt: 'login-password' }).resolves({}); + getCustomPartial.withArgs({ prompt: 'login-passwordless' }).resolves({}); getCustomPartial.withArgs({ prompt: 'signup-password' }).resolves({}); getCustomPartial.withArgs({ prompt: 'signup-id' }).resolves({}); getCustomPartial.withArgs({ prompt: 'signup' }).resolves({});