@RestController @RequestMapping(value="/api") public class AccountResource extends Object
| Constructor and Description |
|---|
AccountResource(UserRepository userRepository,
UserService userService,
PersistentTokenRepository persistentTokenRepository) |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.http.ResponseEntity<String> |
changePassword(String password)
POST /account/change_password : changes the current user's password
|
org.springframework.http.ResponseEntity<UserDTO> |
getAccount()
GET /account : get the current user.
|
org.springframework.http.ResponseEntity<List<PersistentToken>> |
getCurrentSessions()
GET /account/sessions : get the current open sessions.
|
void |
invalidateSession(String series)
DELETE /account/sessions?series={series} : invalidate an existing session.
|
String |
isAuthenticated(javax.servlet.http.HttpServletRequest request)
GET /authenticate : check if the user is authenticated, and return its login.
|
org.springframework.http.ResponseEntity<String> |
registerAccount(ManagedUserVM managedUserVM)
POST /register : register the user.
|
org.springframework.http.ResponseEntity<String> |
saveAccount(UserDTO userDTO)
POST /account : update the current user information.
|
public AccountResource(UserRepository userRepository, UserService userService, PersistentTokenRepository persistentTokenRepository)
@PostMapping(path="/register",
produces={"application/json","text/plain"})
@Timed
public org.springframework.http.ResponseEntity<String> registerAccount(@RequestBody
ManagedUserVM managedUserVM)
managedUserVM - the managed user View Model@GetMapping(value="/authenticate") @Timed public String isAuthenticated(javax.servlet.http.HttpServletRequest request)
request - the HTTP request@GetMapping(value="/account") @Timed public org.springframework.http.ResponseEntity<UserDTO> getAccount()
@PostMapping(value="/account") @Timed public org.springframework.http.ResponseEntity<String> saveAccount(@RequestBody UserDTO userDTO)
userDTO - the current user information@PostMapping(path="/account/change_password",
produces="text/plain")
@Timed
public org.springframework.http.ResponseEntity<String> changePassword(@RequestBody
String password)
password - the new password@GetMapping(value="/account/sessions") @Timed public org.springframework.http.ResponseEntity<List<PersistentToken>> getCurrentSessions()
@DeleteMapping(value="/account/sessions/{series}")
@Timed
public void invalidateSession(@PathVariable
String series)
throws UnsupportedEncodingException
series - the series of an existing sessionUnsupportedEncodingException - if the series couldnt be URL decodedCopyright © 2017 Power TAC. All rights reserved.