Call HttpServletRequest.logout() before HttpSession.invalidate()

MSAL

Add a call to HttpServletRequest#logout(), introduced in Servlet 3.0, before HttpSession#invalidate(), so that a programmatic logout also clears the authenticated user, not only the session. Only applies to standalone invalidate() statements in methods with an HttpServletRequest parameter where the ServletException thrown by logout() is already declared or caught.

org.openrewrite.java.migrate.javax.HttpSessionInvalidate
mod run . --recipe=org.openrewrite.java.migrate.javax.HttpSessionInvalidate

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.