Skip to content

Commit

Permalink
add otp
Browse files Browse the repository at this point in the history
  • Loading branch information
msynk committed Sep 7, 2024
1 parent e904862 commit fd0030b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@

@if (requiresTwoFactor is false)
{
<br /><br />
<br />

<br />
<BitStack Horizontal Gap="1.5rem">
<BitButton IsLoading="isWaiting"
Size="BitSize.Small"
Expand Down Expand Up @@ -113,20 +115,23 @@
<BitPivotItem HeaderText="@Localizer[nameof(AppStrings.Otp)]">
<br />
<div class="form-input-container">
<BitTextField @bind-Value="model.Otp"
CanRevealPassword="true"
Type="BitTextFieldType.Password"
Label="@Localizer[nameof(AppStrings.Otp)]"
AutoComplete="@BitAutoCompleteValue.OneTimeCode"
Placeholder="@Localizer[nameof(AppStrings.OtpPlaceholder)]" />
@* <BitTextField @bind-Value="model.Otp"
CanRevealPassword="true"
Type="BitTextFieldType.Password"
Label="@Localizer[nameof(AppStrings.Otp)]"
AutoComplete="@BitAutoCompleteValue.OneTimeCode"
Placeholder="@Localizer[nameof(AppStrings.OtpPlaceholder)]" /> *@
<BitText>@Localizer[nameof(AppStrings.Otp)]</BitText>
<BitOtpInput @ref="otpInputRef"
@bind-Value="model.Otp" Length="6"
InputType="BitOtpInputType.Password" />
<ValidationMessage For="@(() => model.Otp)" />
</div>
<div class="form-input-container">
<BitButton IsLoading="isSendingOtp"
Variant="BitVariant.Outline"
OnClick="WrapHandled(SendOtp)"
Style="margin-top:4px"
ButtonType="BitButtonType.Button"
Variant="BitVariant.Outline">
ButtonType="BitButtonType.Button">
@Localizer[nameof(AppStrings.SendOtpButtonText)]
</BitButton>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public partial class SignInPage

private string? message;
private BitColor messageColor;
private BitOtpInput otpInputRef = default!;
private ElementReference messageRef = default!;


Expand Down Expand Up @@ -128,6 +129,7 @@ private async Task SendOtp()
finally
{
isSendingOtp = false;
await otpInputRef.FocusAsync();
}
}

Expand Down

0 comments on commit fd0030b

Please sign in to comment.