Skip to content

Commit b65f9cb

Browse files
0Evofeng626
authored andcommitted
fix: Update rememberAuthDisabled logic to respect global setting
1 parent d443aa9 commit b65f9cb

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/app/elements/connect/connect-dialog/select-account/select-account.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { User } from '@app/globals';
22
import { FormControl } from '@angular/forms';
3-
import { AppService, I18nService } from '@app/services';
3+
import { AppService, I18nService, SettingService } from '@app/services';
44
import { BehaviorSubject, ReplaySubject, Subject } from 'rxjs';
55
import { Account, AccountGroup, Asset, AuthInfo, Protocol } from '@app/model';
66

@@ -36,7 +36,7 @@ export class ElementSelectAccountComponent implements OnInit, OnDestroy {
3636
@ViewChild('password', { static: false }) passwordRef: ElementRef;
3737

3838
public hidePassword = true;
39-
public rememberAuthDisabled = false;
39+
public rememberAuthDisabled = !this._settingSvc.globalSetting.SECURITY_LUNA_REMEMBER_AUTH;
4040
usernameControl = new FormControl();
4141
localAuthItems: AuthInfo[];
4242
filteredOptions: AuthInfo[];
@@ -51,6 +51,7 @@ export class ElementSelectAccountComponent implements OnInit, OnDestroy {
5151
private userManuallySelected = false; // 标记用户是否手动选择了账号
5252

5353
constructor(
54+
private _settingSvc: SettingService,
5455
private _appSvc: AppService,
5556
private _i18n: I18nService,
5657
private _cdRef: ChangeDetectorRef

src/app/services/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ export class AppService {
338338
newAuth.alias = account.alias;
339339
}
340340

341-
if (!auth.secret || !auth.rememberAuth) {
341+
if (!auth.secret || !auth.rememberAuth || !this._settingSvc.globalSetting.SECURITY_LUNA_REMEMBER_AUTH) {
342342
newAuth.secret = '';
343343
} else {
344344
newAuth.secret = this.encrypt(auth.secret);

0 commit comments

Comments
 (0)