diff --git a/daemawiki-api/src/main/java/org/daemawiki/domain/auth/usecase/service/SigninService.java b/daemawiki-api/src/main/java/org/daemawiki/domain/auth/usecase/service/SigninService.java index 126cc37b..fdd1f2d0 100644 --- a/daemawiki-api/src/main/java/org/daemawiki/domain/auth/usecase/service/SigninService.java +++ b/daemawiki-api/src/main/java/org/daemawiki/domain/auth/usecase/service/SigninService.java @@ -29,8 +29,12 @@ public Mono signin(LoginRequest request) { return getUserPort.findByEmail(request.email()) .switchIfEmpty(Mono.error(UserNotFoundException.EXCEPTION)) .flatMap(user -> validateUserAndPassword(user, request.password())) - .flatMap(user -> tokenizer.createToken(user.getEmail()) - .map(TokenResponse::create)); + .flatMap(this::generateTokenResponse); + } + + private Mono generateTokenResponse(User user) { + return tokenizer.createToken(user.getEmail()) + .map(TokenResponse::create); } private Mono validateUserAndPassword(User user, String inputPassword) {