Grabbing the current username of logged in user?
s
How does one grab the username of the current logged in user in the context of my web-component? Currently I have this in my super:
Copy code
ts
    @state()
    private currentUserName?: string;
    constructor() {
        super();

        this.consumeContext(UMB_CURRENT_USER_CONTEXT, (context) => {
            this.observe(
                context.currentUser,
                (currentUser) => {
                    this.currentUserName = currentUser?.name;
                },
                'umbCurrentUserObserver'
            )
        });
// removed for brevity
No matter what I do - the username is null 😦
6 Views