* Api: Store recoverable password (encrypted) for shares so you don't have to change it when you forget

This commit is contained in:
nathan
2023-08-14 13:41:18 -06:00
parent 4ffaaea76e
commit 2c5170f15b
5 changed files with 40 additions and 5 deletions

View File

@@ -66,9 +66,16 @@ export class Et2Password extends Et2InvokerMixin(Et2Textbox)
}
attrs.type = 'password';
if(attrs.viewable)
if(typeof attrs.viewable !== "undefined")
{
attrs['passwordToggle'] = true;
attrs['passwordToggle'] = attrs.viewable;
delete attrs.viewable;
}
if(typeof attrs.passwordToggle !== "undefined" && !attrs.passwordToggle
|| typeof attrs.passwordToggle == "string" && !this.getArrayMgr("content").parseBoolExpression(attrs.passwordToggle))
{
// Unset passwordToggle if its false. It's from parent, and it doesn't handle string "false" = false
delete attrs.passwordToggle;
}
super.transformAttributes(attrs);
@@ -149,7 +156,7 @@ export class Et2Password extends Et2InvokerMixin(Et2Textbox)
this.visible = !this.visible; // can't access private isPasswordVisible
if (!this.visible || !this.encrypted)
if(!this.visible || !this.encrypted || !this.value)
{
this.type = this.visible ? 'text' : 'password';
return;