mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 16:37:02 +03:00
Resolve #1501
This commit is contained in:
parent
9ccd616132
commit
58ad745373
2 changed files with 11 additions and 0 deletions
|
|
@ -77,6 +77,16 @@ export class AdminSettingsSecurity extends AbstractViewSettings {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
generateTOTP() {
|
||||||
|
let CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567',
|
||||||
|
length = 16,
|
||||||
|
secret = '';
|
||||||
|
while (0 < length--) {
|
||||||
|
secret += CHARS[Math.floor(Math.random() * 32)];
|
||||||
|
}
|
||||||
|
this.adminTOTP(secret);
|
||||||
|
}
|
||||||
|
|
||||||
saveAdminUserCommand() {
|
saveAdminUserCommand() {
|
||||||
if (!this.adminLogin().trim()) {
|
if (!this.adminLogin().trim()) {
|
||||||
this.adminLoginError(true);
|
this.adminLoginError(true);
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@
|
||||||
<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off"
|
<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off"
|
||||||
pattern="[A-Z2-7]{16,}"
|
pattern="[A-Z2-7]{16,}"
|
||||||
data-bind="textInput: adminTOTP">
|
data-bind="textInput: adminTOTP">
|
||||||
|
<button type="button" data-bind="click:generateTOTP">Generate</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label></label>
|
<label></label>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue