Hi @Filipe Sousa,
how did you managed to add DelegatingHandler in umbraco 8.
I am struggling to migrate my code from v7 to v8 for custom delegatinghandler.
There is also a difference between trying to a User (an Umbraco CMS user) and a Member (like a user that is logged in to the frontend of the website).
The former will not be resolved with "contextReference.UmbracoContext.Security.CurrentUser", while the latter can be resolved like this.
Get current user
Hi there,
how do I get the current user within a DelegatingHandler when loading a page in the backoffice?
I'm injecting the IUmbracoContextFactory and fetching the user like so, but it's always null.
Much appreciated.
Hi Filipe,
On the frontend of the website the user would be null, in the Umbraco backoffice you would be able to get a proper user.
Cheers, Ruben
Hi @Filipe Sousa, how did you managed to add DelegatingHandler in umbraco 8. I am struggling to migrate my code from v7 to v8 for custom delegatinghandler.
Hi @Filipe Sousa,
There is also a difference between trying to a User (an Umbraco CMS user) and a Member (like a user that is logged in to the frontend of the website). The former will not be resolved with "contextReference.UmbracoContext.Security.CurrentUser", while the latter can be resolved like this.
Cheers, Ruben
Filipe, you can try the following to get the current user:
Hope it helps.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.