Extending Users section in Umbraco v13

Hi,

We are trying to extend the Users section in Umbraco 13 Cloud. We were very close and sometimes it works, but most of the time we get a blank page (full white) without any error. The page just stops loading and rendering.

After some research our code, we see that the issue is the way we want to get the current logged in user. We use:

element.element(document.body).injector()

to get the userService. That went well, but when we try to get the currentUser by calling the function:

await userService.getCurrentUser()

it fails loading most of the time.

In this screenshot you see where problem occurs.

The goal is to give Admin users in the backoffice the possibility to give non-Admin users permission to log in between a certain timelimit. We couldn’t find a proper solution for it, so we created it with plain javascript.

Is there someone who has any idea what we can try to fix this issue? Because when it does render the backoffice, it works like it suppose to work.

Any help will be appreciated.