Try to disable remembering password
This commit is contained in:
parent
2660e791d1
commit
8019c81600
@ -196,6 +196,12 @@ class InputField {
|
|||||||
this.input = input;
|
this.input = input;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public select() {
|
||||||
|
if((this.input as HTMLInputElement).value) { // * avoid selecting whole empty field on iOS devices
|
||||||
|
(this.input as HTMLInputElement).select(); // * select text
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public setLabel() {
|
public setLabel() {
|
||||||
this.label.textContent = '';
|
this.label.textContent = '';
|
||||||
if(this.options.labelText) {
|
if(this.options.labelText) {
|
||||||
|
@ -22,11 +22,19 @@ export default class PasswordInputField extends InputField {
|
|||||||
input.type = 'password';
|
input.type = 'password';
|
||||||
input.setAttribute('required', '');
|
input.setAttribute('required', '');
|
||||||
input.autocomplete = 'off';
|
input.autocomplete = 'off';
|
||||||
input.readOnly = true;
|
/* input.readOnly = true;
|
||||||
|
|
||||||
input.addEventListener('focus', () => {
|
input.addEventListener('focus', () => {
|
||||||
input.removeAttribute('readonly');
|
input.removeAttribute('readonly');
|
||||||
}, {once: true});
|
}, {once: true}); */
|
||||||
|
|
||||||
|
// * https://stackoverflow.com/a/35949954/6758968
|
||||||
|
const stealthy = document.createElement('input');
|
||||||
|
stealthy.classList.add('stealthy');
|
||||||
|
stealthy.tabIndex = -1;
|
||||||
|
stealthy.type = 'password';
|
||||||
|
input.parentElement.prepend(stealthy);
|
||||||
|
input.parentElement.insertBefore(stealthy.cloneNode(), input.nextSibling);
|
||||||
|
|
||||||
const toggleVisible = this.toggleVisible = document.createElement('span');
|
const toggleVisible = this.toggleVisible = document.createElement('span');
|
||||||
toggleVisible.classList.add('toggle-visible', 'tgico');
|
toggleVisible.classList.add('toggle-visible', 'tgico');
|
||||||
|
@ -130,6 +130,7 @@ export default class AppTwoStepVerificationEnterPasswordTab extends SliderSuperT
|
|||||||
textEl.key = 'TwoStepAuth.InvalidPassword';
|
textEl.key = 'TwoStepAuth.InvalidPassword';
|
||||||
textEl.update();
|
textEl.update();
|
||||||
preloader.remove();
|
preloader.remove();
|
||||||
|
passwordInputField.select();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,9 +89,11 @@ let onFirstMount = (): Promise<any> => {
|
|||||||
break; */
|
break; */
|
||||||
}
|
}
|
||||||
}).catch(async(err) => {
|
}).catch(async(err) => {
|
||||||
|
let good = false;
|
||||||
switch(err.type) {
|
switch(err.type) {
|
||||||
case 'SESSION_PASSWORD_NEEDED':
|
case 'SESSION_PASSWORD_NEEDED':
|
||||||
//console.warn('pageAuthCode: SESSION_PASSWORD_NEEDED');
|
//console.warn('pageAuthCode: SESSION_PASSWORD_NEEDED');
|
||||||
|
good = true;
|
||||||
err.handled = true;
|
err.handled = true;
|
||||||
await pagePassword.mount();
|
await pagePassword.mount();
|
||||||
break;
|
break;
|
||||||
@ -109,6 +111,10 @@ let onFirstMount = (): Promise<any> => {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!good) {
|
||||||
|
codeInputField.select();
|
||||||
|
}
|
||||||
|
|
||||||
codeInput.removeAttribute('disabled');
|
codeInput.removeAttribute('disabled');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -100,6 +100,7 @@ let onFirstMount = (): Promise<any> => {
|
|||||||
default:
|
default:
|
||||||
//btnNext.innerText = err.type;
|
//btnNext.innerText = err.type;
|
||||||
btnNextI18n.update({key: 'PASSWORD_HASH_INVALID'});
|
btnNextI18n.update({key: 'PASSWORD_HASH_INVALID'});
|
||||||
|
passwordInput.select();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,9 +157,7 @@ let onFirstMount = () => {
|
|||||||
void selectWrapper.offsetWidth; // reflow
|
void selectWrapper.offsetWidth; // reflow
|
||||||
selectWrapper.classList.add('active');
|
selectWrapper.classList.add('active');
|
||||||
|
|
||||||
if(countryInput.value) { // * avoid selecting whole empty field on iOS devices
|
countryInputField.select();
|
||||||
countryInput.select(); // * select text
|
|
||||||
}
|
|
||||||
|
|
||||||
fastSmoothScroll(page.pageEl.parentElement.parentElement, countryInput, 'start', 4);
|
fastSmoothScroll(page.pageEl.parentElement.parentElement, countryInput, 'start', 4);
|
||||||
|
|
||||||
|
@ -1149,3 +1149,17 @@ middle-ellipsis-element {
|
|||||||
font-size: 20px !important;
|
font-size: 20px !important;
|
||||||
padding: 0 2px;
|
padding: 0 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.stealthy {
|
||||||
|
left: 0;
|
||||||
|
margin: 0;
|
||||||
|
max-height: 1px;
|
||||||
|
max-width: 1px;
|
||||||
|
opacity: 0;
|
||||||
|
outline: none;
|
||||||
|
overflow: hidden;
|
||||||
|
pointer-events: none;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user