Profile Menu and Auth0 logout

Hi guys, I have the following code

<AuthorizeView>
    <Authorized>
        <RadzenProfileMenu class="user-select-none">
            <Template>
                <RadzenImage class="rz-gravatar" Path="https://scontent.fsof8-1.fna.fbcdn.net/v/t1.6435-9/159385591_259455865741486_3851244183404558657_n.jpg?_nc_cat=108&ccb=1-7&_nc_sid=09cbfe&_nc_ohc=H_MmzBezzmkAX9f5rzP&_nc_ht=scontent.fsof8-1.fna&oh=00_AfD2Gi07darCMzoJA5AW3DJW9ieKNnU3yBw9rF82ZvREqA&oe=63F75080"></RadzenImage>
            </Template>
            <ChildContent>
                <RadzenProfileMenuItem Text="Излез" @onclick="BeginSignOut" Path="#" Icon="@("<i class=\"fa-solid fa-right-from-bracket\"></i>")"></RadzenProfileMenuItem>

                <li class="rz-navigation-item">
                    <div class="rz-navigation-item-wrapper">
                        <a class="rz-navigation-item-link" @onclick="BeginSignOut">
                            <i class="rzi rz-navigation-item-icon">
                                <i class="fa-solid fa-right-from-bracket"></i>
                            </i>
                            <span class="rz-navigation-item-text">Излез</span>
                        </a>
                    </div>
                </li>   

            </ChildContent>
        </RadzenProfileMenu>
    </Authorized>
</AuthorizeView>

@code {
    private async Task BeginSignOut(MouseEventArgs args)
    {
        await SignOutManager.SetSignOutState();

        Navigation.NavigateTo("authentication/logout");
    }
}

Using RadzenProfileMenuItem to logout does not work, but using the same structure with html elements and classes works perfectly.

This code will never raise the BeginSignOut method since the event is already handled internally. The correct way will be to use the RadzenProfileMenu Click event:

1 Like

Thank you for helping me. It works perfectly now.