Skip to content

Commit

Permalink
feature/google-login
Browse files Browse the repository at this point in the history
  • Loading branch information
rohit-zip committed Jun 13, 2024
1 parent 6f0317a commit f215d4c
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,15 @@ public ResponseEntity<ModuleResponse> forgetPassword(@RequestBody ForgetPassword
public ResponseEntity<RemoteAddressResponse> remoteAddress(HttpServletRequest request) {
return ResponseEntity.ok(AsyncUtils.getAsyncResult(authenticationService.remoteAddress(request)));
}

@GetMapping(EndpointConstants.OAuthController.GOOGLE_LOGIN)
public ResponseEntity<AuthResponse> loginGoogle(@RequestHeader("token") String token, @RequestHeader("secret") String secret, HttpServletRequest httpServletRequest) {
CompletableFuture<AuthResponse> authenticate = authenticationService.loginGoogle(token, secret, httpServletRequest);
AuthResponse asyncResult = AsyncUtils.getAsyncResult(authenticate);
return ResponseEntity
.ok()
.header(HttpHeaders.SET_COOKIE, asyncResult.getCookie().toString())
.header(ServiceConstants.COOKIE_TOKEN, asyncResult.getCookieToken())
.body(asyncResult);
}
}

0 comments on commit f215d4c

Please sign in to comment.