Merge pull request #9163 from abpframework/auto-merge/rel-4-3/416

Merge branch dev with rel-4.3
pull/9169/head
maliming 4 years ago committed by GitHub
commit 65f4ef79d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,4 +1,6 @@
@page "/setting-management"
@using Microsoft.AspNetCore.Authorization
@attribute [Authorize(SettingManagementPermissions.Emailing)]
@* ************************* PAGE HEADER ************************* *@
<PageHeader Title="@L["Settings"]" BreadcrumbItems="@BreadcrumbItems">

@ -1,4 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.Modularity;
@ -42,6 +43,11 @@ namespace Volo.Abp.SettingManagement.Web
options.FileSets.AddEmbedded<AbpSettingManagementWebModule>();
});
Configure<RazorPagesOptions>(options =>
{
options.Conventions.AuthorizePage("/SettingManagement/Index", SettingManagementPermissions.Emailing);
});
Configure<AbpBundlingOptions>(options =>
{
options.ScriptBundles

@ -35,6 +35,7 @@ export abstract class AuthFlowStrategy {
protected configState: ConfigStateService;
protected oAuthService: OAuthService;
protected oAuthConfig: AuthConfig;
protected sessionState: SessionStateService;
protected appConfigService: AbpApplicationConfigurationService;
abstract checkIfInternalAuth(): boolean;
@ -50,6 +51,7 @@ export abstract class AuthFlowStrategy {
this.configState = injector.get(ConfigStateService);
this.oAuthService = injector.get(OAuthService);
this.appConfigService = injector.get(AbpApplicationConfigurationService);
this.sessionState = injector.get(SessionStateService);
this.oAuthConfig = this.environment.getEnvironment().oAuthConfig;
this.listenToOauthErrors();
@ -103,7 +105,9 @@ export class AuthCodeFlowStrategy extends AuthFlowStrategy {
}
navigateToLogin(queryParams?: Params) {
this.oAuthService.initCodeFlow(null, queryParams);
const lang = this.sessionState.getLanguage();
const culture = { culture: lang, 'ui-culture': lang };
this.oAuthService.initCodeFlow(null, { ...(lang && culture), ...queryParams });
}
checkIfInternalAuth() {
@ -180,9 +184,8 @@ export class AuthPasswordFlowStrategy extends AuthFlowStrategy {
}
login(params: LoginParams): Observable<any> {
const sessionState = this.injector.get(SessionStateService);
const router = this.injector.get(Router);
const tenant = sessionState.getTenant();
const tenant = this.sessionState.getTenant();
return from(
this.oAuthService.fetchTokenUsingPasswordFlow(

Loading…
Cancel
Save