How can I use <MudNavLink> as a POST <form> with an <AntiferyToken> in Blazor?
I have a <MudNavMenu> with several <MudNavLink>s. I want to create a logout button in the navigation menu, like the following form with an AntiferyToken:
How can I use <MudNavLink> as a POST <form> with an <AntiferyToken> in Blazor?
I have a <MudNavMenu> with several <MudNavLink>s. I want to create a logout button in the navigation menu, like the following form with an AntiferyToken:
Share
Improve this question
edited Mar 25 at 5:52
Qiang Fu
9,38711 gold badge66 silver badges1616 bronze badges
asked Mar 23 at 18:24
ShuzhengShuzheng14.2k2929 gold badges121121 silver badges232232 bronze badges1
You could try to make the “authentication/logout" action also work for a GET request, so a form isn't needed.
– Peter B
CommentedMar 23 at 18:31
Add a comment
|
1 Answer
1
Reset to default
0
You could use JS Interop to submit the form. Prevent the default behaviour of MudNavLink if you want "Match" attribute works.