Package com.espacogeek.geek.controllers
Class UserController
java.lang.Object
com.espacogeek.geek.controllers.UserController
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateUser(NewUser newUser) deleteUserLogged(org.springframework.security.core.Authentication authentication, String password) doLoginUser(String email, String password, String deviceInfo, graphql.schema.DataFetchingEnvironment environment) Authenticate with email and password.doLogoutUser(graphql.schema.DataFetchingEnvironment environment) doRefreshToken(graphql.schema.DataFetchingEnvironment environment) Obtain a new access token using the refresh token from therefreshTokencookie.editEmailUserLogged(org.springframework.security.core.Authentication authentication, String password, String newEmail) editPasswordUserLogged(org.springframework.security.core.Authentication authentication, String actualPassword, String newPassword) editUsernameUserLogged(org.springframework.security.core.Authentication authentication, String password, String newUsername) isUserLogged(org.springframework.security.core.Authentication authentication) requestPasswordReset(String email) resetPassword(String token, String newPassword) verifyEmailChange(org.springframework.security.core.Authentication authentication, String token)
-
Constructor Details
-
UserController
public UserController()
-
-
Method Details
-
findUser
-
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 namedrefreshToken. -
doRefreshToken
@MutationMapping(name="refreshToken") public AuthPayload doRefreshToken(graphql.schema.DataFetchingEnvironment environment) Obtain a new access token using the refresh token from therefreshTokencookie. Implements token rotation: the old refresh token is invalidated and a new one is issued. -
createUser
-
editPasswordUserLogged
-
deleteUserLogged
-
editUsernameUserLogged
-
editEmailUserLogged
-
requestPasswordReset
-
resetPassword
-
verifyEmailChange
-