From 01c80a82e20cdcdff7ccc7f210aaa5dc07d67ec7 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 26 Jan 2022 20:39:38 +0100 Subject: [PATCH] web/admin: fix SMS Stage form not working closes #2127 Signed-off-by: Jens Langhammer --- .../AuthenticatorSMSStageForm.ts | 207 +++++++++--------- 1 file changed, 99 insertions(+), 108 deletions(-) diff --git a/web/src/pages/stages/authenticator_sms/AuthenticatorSMSStageForm.ts b/web/src/pages/stages/authenticator_sms/AuthenticatorSMSStageForm.ts index ca98c06e3..0990a77f1 100644 --- a/web/src/pages/stages/authenticator_sms/AuthenticatorSMSStageForm.ts +++ b/web/src/pages/stages/authenticator_sms/AuthenticatorSMSStageForm.ts @@ -34,7 +34,7 @@ export class AuthenticatorSMSStageForm extends ModelForm + +

+ ${t`Get this value from https://console.twilio.com`} +

+ + + +

+ ${t`Get this value from https://console.twilio.com`} +

+
`; + } + + renderProviderGeneric(): TemplateResult { + return html` { + const current = (ev.target as HTMLInputElement).value; + this.authType = current as AuthTypeEnum; + }} + ?required=${true} + name="authType" + > + + + + +

+ ${t`This is the full endpoint to send POST requests to.`} +

+
+ + +

+ ${t`This is the username to be used with basic auth or the token when used with bearer token`} +

+
+ + +

+ ${t`This is the password to be used with basic auth`} +

+
`; + } + renderForm(): TemplateResult { return html`
@@ -117,113 +212,9 @@ export class AuthenticatorSMSStageForm extends ModelForm - - - -

- ${t`Get this value from https://console.twilio.com`} -

-
- - -

- ${t`Get this value from https://console.twilio.com`} -

-
- { - const current = (ev.target as HTMLInputElement).value; - this.authType = current as AuthTypeEnum; - }} - ?required=${true} - name="authType" - > - - - - -

- ${t`This is the full endpoint to send POST requests to.`} -

-
- - -

- ${t`This is the username to be used with basic auth or the token when used with bearer token`} -

-
- - -

- ${t`This is the password to be used with basic auth`} -

-
+ ${this.provider === ProviderEnum.Generic + ? this.renderProviderGeneric() + : this.renderProviderTwillio()}