From e99424db0176dd99629cc991aac3cf6f0c2f7014 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 24 Mar 2024 00:37:14 -0700 Subject: [PATCH] Add code. --- .../main/java/com/wisemapping/rest/OAuth2Controller.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wise-api/src/main/java/com/wisemapping/rest/OAuth2Controller.java b/wise-api/src/main/java/com/wisemapping/rest/OAuth2Controller.java index 3a5252a1..983cbc6d 100644 --- a/wise-api/src/main/java/com/wisemapping/rest/OAuth2Controller.java +++ b/wise-api/src/main/java/com/wisemapping/rest/OAuth2Controller.java @@ -67,7 +67,7 @@ public class OAuth2Controller extends BaseController { final RestOath2CallbackResponse result = new RestOath2CallbackResponse(); result.setEmail(user.getEmail()); result.setGoogleSync(user.getGoogleSync()); - result.setSyncCode(user.getSyncCode()); + result.setSyncCode(code); result.setJwtToken(jwtToken); return result; } @@ -75,7 +75,10 @@ public class OAuth2Controller extends BaseController { @RequestMapping(method = RequestMethod.PUT, value = "confirmaccountsync", produces = {"application/json"}) @ResponseStatus(value = HttpStatus.OK) public RestOath2CallbackResponse confirmAccountSync(@NotNull @RequestParam String email, @NotNull @RequestParam String code, @NotNull HttpServletResponse response) throws WiseMappingException { - logger.debug("confirmAccountSync:" + email + "-" + code); + logger.debug("confirmAccountSync:" + email + " - " + code); + if (email == null || code == null) { + throw new WiseMappingException("Illegal argument exception: " + email + " - " + code); + } // Authenticate ... final Account user = userService.createAndAuthUserFromGoogle(code);