diff --git a/docs/en/UI/Angular/Current-User.md b/docs/en/UI/Angular/Current-User.md new file mode 100644 index 0000000000..820a787b5c --- /dev/null +++ b/docs/en/UI/Angular/Current-User.md @@ -0,0 +1,20 @@ +# Angular UI: Current User + +The current user information stored in Config State. + +### How to Get a Current User Information Configuration + +You can use the `getOne` or `getOne$` method of `ConfigStateService` to get a specific configuration property. For that, the property name should be passed to the method as parameter. + +```js +// this.config is an instance of ConfigStateService + +const currentUser = this.config.getOne("currentUser"); + +// or +this.config.getOne$("currentUser").subscribe(currentUser => { + // use currentUser here +}) +``` + +> See the [ConfigStateService](./Config-State-Service) for more information. diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index f764ca0bf2..b919955c6e 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -981,6 +981,10 @@ "text": "Authorization", "path": "UI/Angular/Authorization.md" }, + { + "text": "Current User", + "path": "UI/Angular/Current-User.md" + }, { "text": "HTTP Requests", "path": "UI/Angular/HTTP-Requests.md" diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/UserInfoController.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/UserInfoController.cs index 2126e370be..74fc01c89f 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/UserInfoController.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/UserInfoController.cs @@ -19,7 +19,7 @@ public class UserInfoController : AbpOpenIdDictControllerBase [HttpGet] [HttpPost] [Produces("application/json")] - public async Task Userinfo() + public virtual async Task Userinfo() { var user = await UserManager.GetUserAsync(User); if (user == null)