Class AuthHelper

java.lang.Object
net.bjmsw.hda.vs.helper.AuthHelper

public class AuthHelper extends Object
The AuthHelper class provides methods for handling user authentication and authorization.
  • Constructor Details

    • AuthHelper

      public AuthHelper()
  • Method Details

    • checkLogin

      public static Benutzer checkLogin(Request r)
      Retrieves the logged-in Benutzer (user) based on the authorization token in the request's header.
      Parameters:
      r - Request object containing the authorization token in the headers
      Returns:
      The logged-in Benutzer corresponding to the authorization token, or null if not found
    • checkAuth

      public static boolean checkAuth(Request r, Benutzer.USER_TYPE type)
      Checks if the user in the request is authorized with the specified user type.
      Parameters:
      r - Request object containing the authorization token in the headers
      type - The user type to check authorization against
      Returns:
      True if the user in the request is authorized with the specified user type, otherwise false