Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: auth sign-in 반환값 self-test 추가 #112

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public ResponseEntity<SignInResponseDto> signIn(@RequestBody SignInRequestDto re

String accessToken = jwtProvider.generatorAccessToken(user.getEmail(), user.getId());

SignInResponseDto response = SignInResponseDto.of(accessToken, user.getSocialId());
SignInResponseDto response = SignInResponseDto.of(accessToken, user);
return ResponseEntity.ok().body(response);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
package com.example.holing.bounded_context.auth.dto;

import com.example.holing.bounded_context.user.entity.User;

public record SignInResponseDto(
String accessToken,
Long socialId
Long socialId,
Boolean isSelfTested
) {
public static SignInResponseDto of(String accessToken, Long socialId) {
return new SignInResponseDto(accessToken, socialId);
public static SignInResponseDto of(String accessToken, User user) {
return new SignInResponseDto(
accessToken,
user.getSocialId(),
user.getIsSelfTested()
);
}
}
Loading