Skip to content

Instantly share code, notes, and snippets.

@zzuummaa
Created April 1, 2019 06:12
Show Gist options
  • Save zzuummaa/7f9562651905430b71eb65c8b1a39f43 to your computer and use it in GitHub Desktop.
Save zzuummaa/7f9562651905430b71eb65c8b1a39f43 to your computer and use it in GitHub Desktop.
@PostMapping(SIGN_UP_URL)
public void signUp(@Valid @RequestBody ApplicationUser user) {
user.setPassword(bCryptPasswordEncoder.encode(user.getPassword()));
try {
applicationUserRepository.save(user);
} catch (Throwable e) {
throw RepositoryExceptionExtractor.extract(e, logger, Thread.currentThread().getStackTrace()[1].getMethodName());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment