Class UserController

java.lang.Object
com.espacogeek.geek.controllers.UserController

@Controller public class UserController extends Object
  • Constructor Details

    • UserController

      public UserController()
  • Method Details

    • findUser

      @QueryMapping public List<UserModel> findUser(@Argument(name="id") Integer id, @Argument(name="username") String username, @Argument(name="email") String email)
    • doLogoutUser

      @QueryMapping(name="logout") @PreAuthorize("hasRole(\'user\')") public String doLogoutUser(graphql.schema.DataFetchingEnvironment environment)
    • isUserLogged

      @QueryMapping(name="isLogged") @PreAuthorize("hasRole(\'user\')") public String isUserLogged(org.springframework.security.core.Authentication authentication)
    • doLoginUser

      @MutationMapping(name="login") public AuthPayload doLoginUser(@Argument(name="email") String email, @Argument(name="password") String password, @Argument(name="deviceInfo") String deviceInfo, graphql.schema.DataFetchingEnvironment environment)
      Authenticate with email and password. Returns a short-lived access token in the JSON payload and sets a long-lived refresh token as an HttpOnly cookie named refreshToken.
    • doRefreshToken

      @MutationMapping(name="refreshToken") public AuthPayload doRefreshToken(graphql.schema.DataFetchingEnvironment environment)
      Obtain a new access token using the refresh token from the refreshToken cookie. Implements token rotation: the old refresh token is invalidated and a new one is issued.
    • createUser

      @MutationMapping(name="createUser") public String createUser(@Argument(name="credentials") NewUser newUser)
    • editPasswordUserLogged

      @MutationMapping(name="editPassword") @PreAuthorize("hasRole(\'user\')") public String editPasswordUserLogged(org.springframework.security.core.Authentication authentication, @Argument(name="actualPassword") String actualPassword, @Argument(name="newPassword") String newPassword)
    • deleteUserLogged

      @MutationMapping(name="deleteUser") @PreAuthorize("hasRole(\'user\')") public String deleteUserLogged(org.springframework.security.core.Authentication authentication, @Argument(name="password") String password)
    • editUsernameUserLogged

      @MutationMapping(name="editUsername") @PreAuthorize("hasRole(\'user\')") public String editUsernameUserLogged(org.springframework.security.core.Authentication authentication, @Argument(name="password") String password, @Argument(name="newUsername") String newUsername)
    • editEmailUserLogged

      @MutationMapping(name="editEmail") @PreAuthorize("hasRole(\'user\')") public String editEmailUserLogged(org.springframework.security.core.Authentication authentication, @Argument(name="password") String password, @Argument(name="newEmail") String newEmail)
    • requestPasswordReset

      @MutationMapping(name="requestPasswordReset") public String requestPasswordReset(@Argument(name="email") String email)
    • resetPassword

      @MutationMapping(name="resetPassword") public String resetPassword(@Argument(name="token") String token, @Argument(name="newPassword") String newPassword)
    • verifyEmailChange

      @MutationMapping(name="verifyEmailChange") @PreAuthorize("hasRole(\'user\')") public String verifyEmailChange(org.springframework.security.core.Authentication authentication, @Argument(name="token") String token)