Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MudMenu error with logout #9087

Open
1 of 2 tasks
sardar97 opened this issue May 30, 2024 · 2 comments
Open
1 of 2 tasks

MudMenu error with logout #9087

sardar97 opened this issue May 30, 2024 · 2 comments

Comments

@sardar97
Copy link

Bug type

Component

Component name

MudMenu

What happened?

when i am trying to logout with mudmenu i get this error :

An unhandled exception occurred while processing the request.

AntiforgeryValidationException: The required antiforgery request token was not provided in either form field "__RequestVerificationToken" or header value "RequestVerificationToken".
Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.ValidateRequestAsync(HttpContext httpContext)

BadHttpRequestException: Invalid anti-forgery token found when reading parameter "string returnUrl" from the request body as form.
Microsoft.AspNetCore.Http.RequestDelegateFactory+Log.InvalidAntiforgeryToken(HttpContext httpContext, string parameterTypeName, string parameterName, Exception exception, bool shouldThrow)

here are my codes :

<AuthorizeView>
                <Authorized>
                    <MudMenu>
                        <ActivatorContent>
                            <MudAvatar Elevation="0"  Color="Color.Primary">
                                <MudIcon Icon="@Icons.Material.Filled.Person" Size="Size.Large" />
                            </MudAvatar>
                        </ActivatorContent>
                        <ChildContent>
                            <form action="Account/Logout" method="post">
                                <AntiforgeryToken/>
                                <input type="hidden" name="ReturnUrl" value="@currentUrl"/>
                                <button type="submit">
                                    Logout
                                </button>
                            </form>
                        </ChildContent>
                    </MudMenu>
                </Authorized>
            </AuthorizeView>

Expected behavior

when i am trying to logout with mudmenu i get this error :

An unhandled exception occurred while processing the request.

Reproduction link

try.mudblazor.com

Reproduction steps

1.click logout
2.the bug happened
3.
...

Relevant log output

No response

Version (bug)

6.19.1

Version (working)

No response

What browsers are you seeing the problem on?

Safari

On which operating systems are you experiencing the issue?

macOS

Pull Request

  • I would like to do a Pull Request

Code of Conduct

  • I agree to follow this project's Code of Conduct
@neozhu
Copy link
Contributor

neozhu commented May 31, 2024

MudMenu cannot display ChildContent.

@sardar97
Copy link
Author

MudMenu cannot display ChildContent.

Then why here does?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants