Question: @Autowired public ApplicationUserController ( ApplicationUserService applicationUserService, UserAuthService usersch super ( ) ; this.applicationUserService applicationUserService; this.userAuthService = userAuthService; } @PostMapping ( / register )

@Autowired public ApplicationUserController (ApplicationUserService applicationUserService, UserAuthService usersch super(); this.applicationUserService applicationUserService; this.userAuthService = userAuthService; } @PostMapping("/register") public ResponseEntity register (@RequestBody ApplicationUser user){ boolean isRegistered = userAuthService.registeredUser(user); if (isRegistered){ return ResponseEntity.ok().body("{\"message\": \"Registration successful\"}"); } else { return Response Entity.badRequest().body("{\"message\": \"Password or Username policy failed\"}"); } I @PostMapping("/signin") public ResponseEntity signIn(@RequestBody ApplicationUser user){ String token = userAuthService.authenticate(user); if (token != null){ return ResponseEntity.ok().body("{\"message\": \"Authentication successful!\",\"token\":\""+ token 700%137 characters }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!