Skip to content

Commit

Permalink
feat: bring your own passcode (#816)
Browse files Browse the repository at this point in the history
  • Loading branch information
manchuck authored Apr 25, 2023
1 parent 82399a4 commit e3f9ecb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
12 changes: 12 additions & 0 deletions packages/verify2/__tests__/__dataSets__/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ export default [
channel_timeout: 300,
client_ref: 'my-ref',
code_length: 4,
code: '4242',
} as VerificationRequest,
],
response: [
Expand All @@ -283,6 +284,7 @@ export default [
channelTimeout: 300,
clientRef: 'my-ref',
codeLength: 4,
code: '4242',
} as VerificationRequestParams,
],
expected: {
Expand All @@ -306,6 +308,7 @@ export default [
channel_timeout: 300,
client_ref: 'my-ref',
code_length: 4,
code: '4242',
} as VerificationRequest,
],
response: [
Expand All @@ -329,6 +332,7 @@ export default [
channelTimeout: 300,
clientRef: 'my-ref',
codeLength: 4,
code: '4242',
} as VerificationRequestParams,
],
expected: {
Expand All @@ -352,6 +356,7 @@ export default [
channel_timeout: 300,
client_ref: 'my-ref',
code_length: 4,
code: '4242',
} as VerificationRequest,
],
response: [
Expand All @@ -375,6 +380,7 @@ export default [
channelTimeout: 300,
clientRef: 'my-ref',
codeLength: 4,
code: '4242',
} as VerificationRequestParams,
],
expected: {
Expand All @@ -398,6 +404,7 @@ export default [
channel_timeout: 300,
client_ref: 'my-ref',
code_length: 4,
code: '4242',
} as VerificationRequest,
],
response: [
Expand All @@ -421,6 +428,7 @@ export default [
channelTimeout: 300,
clientRef: 'my-ref',
codeLength: 4,
code: '4242',
} as VerificationRequestParams,
],
expected: {
Expand All @@ -444,6 +452,7 @@ export default [
channel_timeout: 300,
client_ref: 'my-ref',
code_length: 4,
code: '4242',
} as VerificationRequest,
],
response: [
Expand All @@ -467,6 +476,7 @@ export default [
channelTimeout: 300,
clientRef: 'my-ref',
codeLength: 4,
code: '4242',
} as VerificationRequestParams,
],
expected: {
Expand All @@ -490,6 +500,7 @@ export default [
channel_timeout: 300,
client_ref: 'my-ref',
code_length: 4,
code: '4242',
} as VerificationRequest,
],
response: [
Expand All @@ -513,6 +524,7 @@ export default [
channelTimeout: 300,
clientRef: 'my-ref',
codeLength: 4,
code: '4242',
} as VerificationRequestParams,
],
expected: {
Expand Down
7 changes: 2 additions & 5 deletions packages/verify2/lib/types/verifcationRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,17 @@ import { VoiceWorkflow } from './voiceWorkflow';
import { WhatsAppInteractiveWorkflow } from './whatsAppInteractiveWorkflow';
import { WhatsAppWorkflow } from './whatsAppWorkflow';

type SMSWorkFlowRequest = {
app_has: string
} & Omit<SMSWorkflow, 'appHash'>

export type VerificationRequest = {
brand: string
workflow: Array<
| EmailWorkflow
| SMSWorkFlowRequest
| (Omit<SMSWorkflow, 'appHash'> & { app_hash: string })
| SilentAuthWorkflow
| VoiceWorkflow
| WhatsAppInteractiveWorkflow
| WhatsAppWorkflow
>
code?: string
locale?: VerifyLocale
channel_timeout?: number
client_ref?: string
Expand Down
1 change: 1 addition & 0 deletions packages/verify2/lib/types/verifcationRequestParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export type VerificationRequestParams = {
| WhatsAppInteractiveWorkflow
| WhatsAppWorkflow
>
code?: string
locale?: VerifyLocale
channelTimeout?: number
clientRef?: string
Expand Down

0 comments on commit e3f9ecb

Please sign in to comment.