Package com.openmeet.webapp.logicLayer.filters

# Class AuthenticationFilter

java.lang.Object
com.openmeet.webapp.logicLayer.filters.AuthenticationFilter

All Implemented Interfaces:
  `jakarta.servlet.Filter`

public class AuthenticationFilter extends Object implements jakarta.servlet.Filter
This class is used to filter all requests and check if the user is authenticated.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AuthenticationFilter()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `destroy()`
  `void`
  `doFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse resp, jakarta.servlet.FilterChain chain)`
  Checks if the user is authenticated.
  `void`
  `init(jakarta.servlet.FilterConfig fConfig)`

  ### Methods inherited from class java.lang.Object

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

- ## Constructor Details

  - ### AuthenticationFilter

    public AuthenticationFilter()

- ## Method Details

  - ### init

    public void init(jakarta.servlet.FilterConfig fConfig)
    Specified by:
      `init` in interface `jakarta.servlet.Filter`

  - ### doFilter

    public void doFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse resp, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException
    Checks if the user is authenticated. If not, the user will be redirected to the login page.
    Specified by:
      `doFilter` in interface `jakarta.servlet.Filter`
    Parameters:
      `req` - the request. It is used to get the session and the request URI.
      `resp` - the response. It is used to redirect the user to the login page.
    Throws:
      `IOException`
      `jakarta.servlet.ServletException`

  - ### destroy

    public void destroy()
    Specified by:
      `destroy` in interface `jakarta.servlet.Filter`