//FIXME use Auth header with basic auth
@GetMapping("/sign-in")
    Mono<JwtToken> signIn(@RequestParam("login") String login,//FIXME use Auth header with basic auth
                          @RequestParam("password") String password) {
        return userRepository.findByEmailOrMobile(login, login)
                .filter(u -> u.validatePassword(password))
                .map(this::createToken)
                .map(Mono::just)
                .orElseThrow(() -> new IllegalArgumentException("Invalid login or password"));
    }
@GetMapping("/sign-in")
Mono<JwtToken> signIn(@RequestParam("login") String login,//FIXME use Auth header with basic auth
@RequestParam("password") String password) {
return userRepository.findByEmailOrMobile(login, login)
@GetMapping("/sign-in")
Mono<JwtToken> signIn(@RequestParam("login") String login,//FIXME use Auth header with basic auth
@RequestParam("password") String password) {
return userRepository.findByEmailOrMobile(login, login)
.filter(u -> u.validatePassword(password))
.map(this::createToken)
.map(Mono::just)
.orElseThrow(() -> new IllegalArgumentException("Invalid login or password"));
}
@GetMapping("/sign-in")
Mono<JwtToken> signIn(@RequestParam("login") String login,//FIXME use Auth header with basic auth
@RequestParam("password") String password) {
return userRepository.findByEmailOrMobile(login, login)
.filter(u -> u.validatePassword(password))
.map(this::createToken)
.map(Mono::just)
.orElseThrow(() -> new IllegalArgumentException("Invalid login or password"));
}