diff --git a/docs/en/Modules/OpenIddict.md b/docs/en/Modules/OpenIddict.md index 2c8ae7572e..22cb22bf55 100644 --- a/docs/en/Modules/OpenIddict.md +++ b/docs/en/Modules/OpenIddict.md @@ -330,7 +330,19 @@ public class MyClaimDestinationsProvider : IAbpOpenIddictClaimDestinationsProvid { public virtual Task SetDestinationsAsync(AbpOpenIddictClaimDestinationsProviderContext context) { - // ... + foreach (var claim in context.Claims) + { + if (claim.Type == MyClaims.MyClaimsType) + { + claim.SetDestinations(OpenIddictConstants.Destinations.AccessToken, OpenIddictConstants.Destinations.IdentityToken); + } + + if (claim.Type == MyClaims.MyClaimsType2) + { + claim.SetDestinations(OpenIddictConstants.Destinations.AccessToken); + } + } + return Task.CompletedTask; } } diff --git a/npm/ng-packs/packages/account/src/lib/account-routing.module.ts b/npm/ng-packs/packages/account/src/lib/account-routing.module.ts index c09dede3cb..e4b18a717b 100644 --- a/npm/ng-packs/packages/account/src/lib/account-routing.module.ts +++ b/npm/ng-packs/packages/account/src/lib/account-routing.module.ts @@ -13,6 +13,8 @@ import { RegisterComponent } from './components/register/register.component'; import { ResetPasswordComponent } from './components/reset-password/reset-password.component'; import { eAccountComponents } from './enums/components'; import { AuthenticationFlowGuard } from './guards/authentication-flow.guard'; +import { AccountExtensionsGuard } from './guards'; + const routes: Routes = [ { path: '', pathMatch: 'full', redirectTo: 'login' }, @@ -68,7 +70,7 @@ const routes: Routes = [ { path: 'manage', component: ReplaceableRouteContainerComponent, - canActivate: [AuthGuard], + canActivate: [AuthGuard, AccountExtensionsGuard], data: { replaceableComponent: { key: eAccountComponents.ManageProfile, diff --git a/npm/ng-packs/packages/account/src/lib/account.module.ts b/npm/ng-packs/packages/account/src/lib/account.module.ts index bfa37d4bfa..bdf3c39792 100644 --- a/npm/ng-packs/packages/account/src/lib/account.module.ts +++ b/npm/ng-packs/packages/account/src/lib/account.module.ts @@ -15,6 +15,10 @@ import { accountConfigOptionsFactory } from './utils/factory-utils'; import { AuthenticationFlowGuard } from './guards/authentication-flow.guard'; import { ForgotPasswordComponent } from './components/forgot-password/forgot-password.component'; import { ResetPasswordComponent } from './components/reset-password/reset-password.component'; +import { UiExtensionsModule } from '@abp/ng.theme.shared/extensions'; +import { ACCOUNT_EDIT_FORM_PROP_CONTRIBUTORS } from './tokens/extensions.token'; +import { AccountExtensionsGuard } from './guards/extensions.guard'; +import { PersonalSettingsHalfRowComponent } from './components/personal-settings/personal-settings-half-row.component'; const declarations = [ LoginComponent, @@ -24,6 +28,7 @@ const declarations = [ PersonalSettingsComponent, ForgotPasswordComponent, ResetPasswordComponent, + PersonalSettingsHalfRowComponent, ]; @NgModule({ @@ -34,6 +39,7 @@ const declarations = [ ThemeSharedModule, NgbDropdownModule, NgxValidateCoreModule, + UiExtensionsModule, ], exports: [...declarations], }) @@ -49,6 +55,11 @@ export class AccountModule { useFactory: accountConfigOptionsFactory, deps: [ACCOUNT_CONFIG_OPTIONS], }, + { + provide: ACCOUNT_EDIT_FORM_PROP_CONTRIBUTORS, + useValue: options.editFormPropContributors, + }, + AccountExtensionsGuard, ], }; } diff --git a/npm/ng-packs/packages/account/src/lib/components/index.ts b/npm/ng-packs/packages/account/src/lib/components/index.ts index 098ee8a202..d74263b052 100644 --- a/npm/ng-packs/packages/account/src/lib/components/index.ts +++ b/npm/ng-packs/packages/account/src/lib/components/index.ts @@ -4,4 +4,5 @@ export * from './login/login.component'; export * from './manage-profile/manage-profile.component'; export * from './register/register.component'; export * from './personal-settings/personal-settings.component'; +export * from './personal-settings/personal-settings-half-row.component'; export * from './reset-password/reset-password.component'; diff --git a/npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings-half-row.component.ts b/npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings-half-row.component.ts new file mode 100644 index 0000000000..a000e353d6 --- /dev/null +++ b/npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings-half-row.component.ts @@ -0,0 +1,37 @@ +import { Component, Inject } from '@angular/core'; +import { + EXTENSIONS_FORM_PROP, + FormProp, + EXTENSIBLE_FORM_VIEW_PROVIDER, +} from '@abp/ng.theme.shared/extensions'; +import { FormGroup } from '@angular/forms'; + +@Component({ + selector: 'abp-personal-settings-half-row', + template: `