Browse Source

Fixing login issue

main
ddangelorb 3 years ago
parent
commit
e811f3a9d0
  1. 10
      src/main/java/org/waterproofingdata/wpdauth/controller/UsersController.java
  2. 2
      src/main/java/org/waterproofingdata/wpdauth/dto/UsersResponseDTO.java
  3. 2
      src/main/java/org/waterproofingdata/wpdauth/security/WebSecurityConfig.java

10
src/main/java/org/waterproofingdata/wpdauth/controller/UsersController.java

@ -35,7 +35,7 @@ public class UsersController {
private ModelMapper modelMapper;
@PostMapping("/login")
@ApiOperation(value = "${UserController.signin}")
@ApiOperation(value = "${UserController.login}")
@ApiResponses(value = {//
@ApiResponse(code = 400, message = "Something went wrong"), //
@ApiResponse(code = 422, message = "Invalid username/password supplied")})
@ -78,8 +78,8 @@ public class UsersController {
@ApiResponse(code = 500, message = "Expired or invalid JWT token")})
public UsersResponseDTO search(@ApiParam("Username") @PathVariable String username) {
UsersResponseDTO urDTO = modelMapper.map(userService.search(username), UsersResponseDTO.class);
urDTO.setEduCemadenOrganization(userService.findEduCemadenOrganizationById(urDTO.getId()));
urDTO.setRolesProviderActivationKeys(userService.findRolesproviderActivationKeysById(urDTO.getId()));
//urDTO.setEduCemadenOrganization(userService.findEduCemadenOrganizationById(urDTO.getId()));
//urDTO.setRolesProviderActivationKeys(userService.findRolesproviderActivationKeysById(urDTO.getId()));
return urDTO;
}
@ -92,8 +92,8 @@ public class UsersController {
@ApiResponse(code = 500, message = "Expired or invalid JWT token")})
public UsersResponseDTO whoami(HttpServletRequest req) {
UsersResponseDTO urDTO = modelMapper.map(userService.whoami(req), UsersResponseDTO.class);
urDTO.setEduCemadenOrganization(userService.findEduCemadenOrganizationById(urDTO.getId()));
urDTO.setRolesProviderActivationKeys(userService.findRolesproviderActivationKeysById(urDTO.getId()));
//urDTO.setEduCemadenOrganization(userService.findEduCemadenOrganizationById(urDTO.getId()));
//urDTO.setRolesProviderActivationKeys(userService.findRolesproviderActivationKeysById(urDTO.getId()));
return urDTO;
}

2
src/main/java/org/waterproofingdata/wpdauth/dto/UsersResponseDTO.java

@ -22,9 +22,11 @@ public class UsersResponseDTO {
@ApiModelProperty(position = 2)
List<Roles> roles;
/*
@ApiModelProperty(position = 3)
EduCemadenOrganizations eduCemadenOrganization;
@ApiModelProperty(position = 4)
List<UsersRolesproviderActivationKey> rolesProviderActivationKeys;
*/
}

2
src/main/java/org/waterproofingdata/wpdauth/security/WebSecurityConfig.java

@ -33,7 +33,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
// Entry points
http.authorizeRequests()//
.antMatchers("/users/signin").permitAll()//
.antMatchers("/users/login").permitAll()//
.antMatchers("/users/signup").permitAll()//
.antMatchers("/h2-console/**/**").permitAll()
// Disallow everything else..

Loading…
Cancel
Save