mirror of https://github.com/abpframework/abp.git
6 changed files with 28 additions and 19 deletions
@ -1,21 +1,5 @@ |
|||
import { InjectionToken, inject } from '@angular/core'; |
|||
import { EnvironmentService } from '../services/environment.service'; |
|||
import { InjectionToken } from '@angular/core'; |
|||
|
|||
export const NAVIGATE_TO_MANAGE_PROFILE = new InjectionToken<() => void>( |
|||
'NAVIGATE_TO_MANAGE_PROFILE', |
|||
{ |
|||
providedIn: 'root', |
|||
factory: () => { |
|||
const environment = inject(EnvironmentService); |
|||
|
|||
return () => { |
|||
window.open( |
|||
`${environment.getEnvironment().oAuthConfig.issuer}/Account/Manage?returnUrl=${ |
|||
window.location.href |
|||
}`,
|
|||
'_self', |
|||
); |
|||
}; |
|||
}, |
|||
}, |
|||
); |
|||
|
|||
@ -0,0 +1 @@ |
|||
export * from './navigate-to-manage-profile.provider'; |
|||
@ -0,0 +1,21 @@ |
|||
import { inject, Provider } from '@angular/core'; |
|||
import { EnvironmentService, NAVIGATE_TO_MANAGE_PROFILE } from '@abp/ng.core'; |
|||
|
|||
export const NavigateToManageProfileProvider: Provider = { |
|||
provide: NAVIGATE_TO_MANAGE_PROFILE, |
|||
useFactory: () => { |
|||
const environment = inject(EnvironmentService); |
|||
|
|||
return () => { |
|||
const env = environment.getEnvironment(); |
|||
if (!env.oAuthConfig) { |
|||
console.warn('The oAuthConfig env is missing on environment.ts'); |
|||
return; |
|||
} |
|||
window.open( |
|||
`${env.oAuthConfig.issuer}/Account/Manage?returnUrl=${window.location.href}`, |
|||
'_self', |
|||
); |
|||
}; |
|||
}, |
|||
}; |
|||
Loading…
Reference in new issue