mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-08 06:48:51 +00:00
fix(login(js)): input focus on TOTP field
This commit is contained in:
@@ -134,7 +134,11 @@
|
||||
<md-input-container class="md-block">
|
||||
<label><var:string label:value="Verification Code"/></label>
|
||||
<md-icon>lock</md-icon>
|
||||
<input type="text" ng-pattern="app.verificationCodePattern" ng-model="app.creds.verificationCode" ng-required="app.loginState == 'totpcode'"/>
|
||||
<input type="text"
|
||||
ng-pattern="app.verificationCodePattern"
|
||||
ng-model="app.creds.verificationCode"
|
||||
ng-required="app.loginState == 'totpcode'"
|
||||
sg-focus-on="totpcode"/>
|
||||
<div class="sg-hint"><var:string label:value="Enter the 6-digit verification code from your TOTP application."/></div>
|
||||
</md-input-container>
|
||||
<div layout="row" layout-align="space-between center">
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
/**
|
||||
* @ngInject
|
||||
*/
|
||||
LoginController.$inject = ['$scope', '$window', '$timeout', 'Dialog', '$mdDialog', 'Authentication'];
|
||||
function LoginController($scope, $window, $timeout, Dialog, $mdDialog, Authentication) {
|
||||
LoginController.$inject = ['$scope', '$window', '$timeout', 'Dialog', '$mdDialog', 'Authentication', 'sgFocus'];
|
||||
function LoginController($scope, $window, $timeout, Dialog, $mdDialog, Authentication, focus) {
|
||||
var vm = this;
|
||||
|
||||
this.$onInit = function() {
|
||||
@@ -43,6 +43,7 @@
|
||||
|
||||
if (data.totpmissingkey) {
|
||||
vm.loginState = 'totpcode';
|
||||
focus('totpcode');
|
||||
}
|
||||
else if (data.totpdisabled) {
|
||||
vm.loginState = 'totpdisabled';
|
||||
|
||||
Reference in New Issue
Block a user