code: @POST
      @Produces(MediaType.APPLICATION_JSON)
      @Consumes(MediaType.APPLICATION_JSON)
      @Description("Authenticates a user and returns access and refresh tokens.")
      @Path("/login")
      public Response login(@Context HttpServletRequest req, final CredentialsDto creds) {
          try {
              PrincipalUser user = authService.getUser(creds.getUsername(), creds.getPassword());
  
              if (user != null) {
                  JWTUtils.Tokens tokens = JWTUtils.generateTokens(user.getUserName());
                  req.setAttribute(AuthFilter.USER_ATTRIBUTE_NAME, user.getUserName());
                  return Response.ok(tokens).build();
              } else {
                  throw new WebApplicationException("User does not exist. Please provide valid credentials.", Response.Status.UNAUTHORIZED);
              }
          } catch (Exception ex) {
              throw new WebApplicationException("Exception: " + ex.getMessage(), Response.Status.UNAUTHORIZED);
          }
      }
docs: Authenticates a user and return JsonWebTokens (AccessToken and RefreshToken).
  
  @param   req    The HTTP request.
  @param   creds  The credentials with which to authenticate.
  
  @return  The tokens (access and refresh) or Exception if authentication fails.
  
  @throws  WebApplicationException  If the user is not authenticated.