From 05e04948e609c069bcf421a8c2cf70200d7817db Mon Sep 17 00:00:00 2001 From: sumeyyeKurtulus Date: Thu, 29 Aug 2024 11:52:17 +0300 Subject: [PATCH 1/2] add: `getRequiredPasswordLength` to sustain possible length constraint --- .../core/src/lib/utils/generator-utils.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/core/src/lib/utils/generator-utils.ts b/npm/ng-packs/packages/core/src/lib/utils/generator-utils.ts index 7b95e71a59..4c4dd99628 100644 --- a/npm/ng-packs/packages/core/src/lib/utils/generator-utils.ts +++ b/npm/ng-packs/packages/core/src/lib/utils/generator-utils.ts @@ -1,3 +1,7 @@ +import { Injector } from '@angular/core'; +import { ABP } from '../models'; +import { ConfigStateService } from '../services'; + export function uuid(a?: any): string { return a ? (a ^ ((Math.random() * 16) >> (a / 4))).toString(16) @@ -16,7 +20,11 @@ export function generateHash(value: string): number { return hashed; } -export function generatePassword(length = 8) { +export function generatePassword(injector?: Injector, length = 8) { + if (injector) { + length = getRequiredPasswordLength(injector); + } + length = Math.min(Math.max(4, length), 128); const lowers = 'abcdefghijklmnopqrstuvwxyz'; @@ -39,3 +47,9 @@ export function generatePassword(length = 8) { return password.sort(() => 0.5 - Math.random()).join(''); } + +function getRequiredPasswordLength(injector: Injector) { + const configState = injector.get(ConfigStateService); + const passwordRules: ABP.Dictionary = configState.getSettings('Identity.Password'); + return Number(passwordRules['Abp.Identity.Password.RequiredLength']) || 8; +} From 26636a5104c6f5b4cf2540613b4560e6bc61a05a Mon Sep 17 00:00:00 2001 From: EngincanV Date: Mon, 2 Sep 2024 15:02:15 +0300 Subject: [PATCH 2/2] Update studio/overview.md --- docs/en/studio/overview.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/en/studio/overview.md b/docs/en/studio/overview.md index c60e80a256..ecfdda52bc 100644 --- a/docs/en/studio/overview.md +++ b/docs/en/studio/overview.md @@ -40,8 +40,9 @@ The top menu is the main menu bar in ABP Studio. It offers access to various fun ### Tools Menu - **Options** - - **Theme:** Allows to change UI theme. -- **Extensions:** Opens the extension management window. + - **Theme:** Allows to change UI theme. +- **Global secrets**: Allows to add global secrets. +- **Global metadata**: Allows to add global metadata. ### Help Menu @@ -50,6 +51,7 @@ The top menu is the main menu bar in ABP Studio. It offers access to various fun - **Community:** Opens the official [ABP Community](https://abp.io/community) website in your browser. - **Support:** Opens the official [Support](https://abp.io/support/questions) website in your browser. - **My Support Questions:** Opens the page on the official Support website in your browser showing the tickets you have opened. +- **Check for updates:** Checks for new version of ABP Studio. - **About:** Opens the about window of ABP Studio where you can get more information about it. ## Welcome Screen