Authentication

- add AuthenticationController
- add AuthenticationService
- add getUserByUsername to AccountService
- add findByUsername to AccountRepository
- add SecurityConfiguration
- set up authentication
This commit is contained in:
2024-12-30 17:07:25 +01:00
parent 6aee16c4a2
commit 0681e367e7
14 changed files with 223 additions and 2 deletions

View File

@@ -21,4 +21,10 @@ class AccountService(
): Mono<AccountEntity> = accountRepository.findById(uuid)
.doOnNext { log.debug { "Get account ${it.id}" } }
.switchIfEmpty(Mono.error(ResponseStatusException(HttpStatus.NOT_FOUND)))
fun getUserByUsername(
username: String,
): Mono<AccountEntity> = accountRepository.findByUsername(username)
.doOnNext { log.debug { "Get account ${it.id} for username $username" } }
.switchIfEmpty(Mono.error(ResponseStatusException(HttpStatus.NOT_FOUND)))
}