From c58e683abc6bcfcf4ea4342b3a25d985364f2899 Mon Sep 17 00:00:00 2001 From: Parker McMullin Date: Mon, 1 Apr 2024 21:34:46 -0700 Subject: [PATCH] chore: add Basic auth guard --- configure.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/configure.ts b/configure.ts index cf2c6f7..45d5108 100644 --- a/configure.ts +++ b/configure.ts @@ -33,6 +33,10 @@ export async function configure(command: Configure) { name: 'access_tokens', message: 'Opaque access tokens', }, + { + name: 'basic_auth', + message: 'Basic Auth', + }, ], { validate(value) { @@ -46,16 +50,16 @@ export async function configure(command: Configure) { * Ensure selected or guard defined via the CLI flag is * valid */ - if (!['session', 'access_tokens'].includes(guard!)) { + if (!['session', 'access_tokens', 'basic_auth'].includes(guard!)) { command.logger.error( - `The selected guard "${guard}" is invalid. Select one from: session, access_tokens` + `The selected guard "${guard}" is invalid. Select one from: session, access_tokens, basic_auth` ) command.exitCode = 1 return } await presetAuth(codemods, command.app, { - guard: guard as 'session' | 'access_tokens', + guard: guard as 'session' | 'access_tokens' | 'basic_auth', userProvider: 'lucid', }) }