localhost como server keycloak

This commit is contained in:
2021-03-19 20:04:10 +01:00
parent d0a89ee677
commit 63a2bca566
2 changed files with 5 additions and 4 deletions

View File

@@ -25,7 +25,7 @@ class PrivateTravelRestController(
return response {
val driver = userRepository.findByIdOrNull(authService.currentUser().id)
?: throw UserIdNotFoundException("Current user not found.")
if (travelRepository.findByIdOrNull(travel.id) != null)
if (travel.id != null && (travelRepository.findByIdOrNull(travel.id) != null))
throw CannotDuplicateIdException("Travel id already exists.")
println("travel des=${travel.description}")
travel.driverInfo = UserInfoDto(driver)

View File

@@ -1,6 +1,7 @@
#spring.security.oauth2.resourceserver.jwt.issuer-uri=http://localhost:8081/auth/realms/fosil
spring.security.oauth2.resourceserver.jwt.issuer-uri=https://auth.fosil.eu/auth/realms/test
spring.security.oauth2.resourceserver.jwt.issuer-uri=http://localhost:8080/auth/realms/okupamicoche
#spring.security.oauth2.resourceserver.jwt.issuer-uri=https://auth.fosil.eu/auth/realms/test
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:h2:file:./okupamicoche;DB_CLOSE_ON_EXIT=FALSE;AUTO_RECONNECT=TRUE
spring.datasource.driver-class-name=org.h2.Driver
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
server.port=8081