Skip to content

Blazor Web Individual Account Template does not have the Logout form handler #51489

@Kumima

Description

@Kumima

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

Issue #51134 replace the LogoutForm into a standard post form. This can fix the problem that the LogoutForm won't work when nested in Interactive RenderMode, since it needs the HttpContext. The standard post form needs a form handler, but I did not find the endpoint definition of Account/Logout. Thre will be no handler for the logout form. If I get something wrong?

- <LogoutForm id="logout-form" />
- <NavLink class="nav-link" href="#" onclick="document.getElementById('logout-form').submit(); return false;">
-     <span class="bi bi-arrow-bar-left-nav-menu" aria-hidden="true"></span> Logout
- </NavLink>
+ <form action="Account/Logout" method="post">
+   <AntiforgeryToken />
+     <input type="hidden" name="ReturnUrl" value="@currentUrl" />
+     <button type="submit" class="nav-link">
+         <span class="bi bi-arrow-bar-left-nav-menu" aria-hidden="true"></span> Logout
+     </button>
+ </form>

Describe the solution you'd like

Add the needed form handler if there is something wrong. If not, point out the existing handler code location.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: DuplicateResolved as a duplicate of another issueStatus: Resolvedarea-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions