Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Result changeEmail(){
- if(session("login")==null)
- return badRequest("you didn't authorize");
- JsonNode json;
- try{
- json = request().body().asJson();
- }
- catch (Exception e){
- return notAcceptable("no body json");
- }
- String email = json.findValue("email").asText();
- if(email==null)
- return notAcceptable("no email");
- Пользователь user = Пользователь.find.query().where().eq("name",session("login")).findUnique();
- user.email=email;
- return ok("email changed");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement