Skip to content

Commit

Permalink
Rollback some #14816 changes to fix 2FA (#15317)
Browse files Browse the repository at this point in the history
  • Loading branch information
kjac authored Nov 30, 2023
1 parent 016709e commit 528b7d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ public async Task<IActionResult> PostSend2FACode([FromBody] string provider)
await _signInManager.TwoFactorSignInAsync(model.Provider, model.Code, model.IsPersistent, model.RememberClient);
if (result.Succeeded)
{
return GetUserDetail(_userService.GetByUsername(user.UserName));
return Ok(GetUserDetail(_userService.GetByUsername(user.UserName)));
}

if (result.IsLockedOut)
Expand Down
20 changes: 10 additions & 10 deletions src/Umbraco.Web.UI.Client/src/views/common/login-2fa.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div ng-controller="Umbraco.Login2faController as vm" class="umb-login-container">
<div ng-controller="Umbraco.Login2faController as cvm" class="umb-login-container">
<div id="twoFactorlogin" ng-cloak="">
<form name="vm.authForm" method="POST" ng-submit="vm.validate()">
<form name="cvm.authForm" method="POST" ng-submit="cvm.validate()">
<header class="h4">
<localize key="login_2fatitle">One last step</localize>
</header>
Expand All @@ -12,19 +12,19 @@
<br>

<!-- if there's only one provider active, it will skip this step! -->
<umb-control-group ng-if="vm.providers.length > 1" label="@login_2faMultipleText" label-for="provider" alias="2faprovider">
<select id="2faprovider" name="provider" ng-model="vm.provider">
<option ng-repeat="provider in vm.providers" ng-value="provider">{{provider}}</option>
<umb-control-group ng-if="cvm.providers.length > 1" label="@login_2faMultipleText" label-for="provider" alias="2faprovider">
<select id="2faprovider" name="provider" ng-model="cvm.provider">
<option ng-repeat="provider in cvm.providers" ng-value="provider">{{provider}}</option>
</select>
</umb-control-group>

<umb-control-group label-for="token" alias="2facode" label="@login_2faCodeInput" description="@user_2faDisableText" required="true">

<input type="text" id="2facode" class="-full-width-input input-xlarge" name="token"
inputmode="numeric" autocomplete="one-time-code" ng-model="vm.code" localize="placeholder"
inputmode="numeric" autocomplete="one-time-code" ng-model="cvm.code" localize="placeholder"
placeholder="@login_2faCodeInputHelp" aria-required="true" required umb-auto-focus no-dirty-check />

<div ng-messages="vm.authForm.token.$error" role="alert">
<div ng-messages="cvm.authForm.token.$error" role="alert">
<span class="umb-validation-label" ng-message="token">
<localize key="login_2faInvalidCode">Invalid code entered</localize>
</span>
Expand All @@ -37,14 +37,14 @@
button-style="success"
size="m"
label-key="general_validate"
state="vm.stateValidateButton"
disabled="vm.code.length === 0">
state="cvm.stateValidateButton"
disabled="cvm.code.length === 0">
</umb-button>
<umb-button
type="button"
size="m"
label-key="general_back"
action="vm.goBack()">
action="cvm.goBack()">
</umb-button>
</div>
</form>
Expand Down

0 comments on commit 528b7d3

Please sign in to comment.