Class LogOut

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
me.nickhanson.codeforge.controller.LogOut
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable, PropertiesLoader

@WebServlet("/logout") public class LogOut extends jakarta.servlet.http.HttpServlet implements PropertiesLoader
Handles user logout by invalidating the local session and redirecting to Cognito logout. Sends the user to the Cognito logout endpoint, which then redirects back to the application.
Author:
Nick Hanson
See Also:
  • Field Summary

    Fields inherited from class jakarta.servlet.http.HttpServlet

    LEGACY_DO_HEAD
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)
    Handles logout by invalidating the local session and redirecting to Cognito logout.
    void
     

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, init, service, service

    Methods inherited from class jakarta.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface me.nickhanson.codeforge.config.PropertiesLoader

    loadProperties
  • Constructor Details

    • LogOut

      public LogOut()
  • Method Details

    • init

      public void init()
      Overrides:
      init in class jakarta.servlet.GenericServlet
    • doGet

      protected void doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws IOException
      Handles logout by invalidating the local session and redirecting to Cognito logout.
      Overrides:
      doGet in class jakarta.servlet.http.HttpServlet
      Parameters:
      req - the HTTP request
      resp - the HTTP response
      Throws:
      IOException - if an input or output error occurs