Skip to content

Commit

Permalink
feat : 애플 로그인 API 암호화 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
1000kkannoo committed Aug 11, 2024
1 parent f6f4626 commit 11955a2
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ public class AccountService {
@Value("${apple.redirect-url}")
private String appleRedirectUrl;

@Value("${oauth.password}")
private String oauthPassword;

@Value("${oauth.non-encryption-password}")
private String nonEncryptionPassword;

public static final int FIX_AGE_DAY = 1;

/**
Expand Down Expand Up @@ -170,12 +176,12 @@ public HttpHeaders appleLogin(MultiValueMap<String, Object> request) {
Account account = optionalAccount.orElseGet(() ->
accountRepository.save(Account.builder()
.email(appleEmail)
.password("$2a$10$7NPHBBkAuyWG/lJz6Yv8/.n099SecuAwWkQq4DMkxeVKWl/R7o5.2")
.password(oauthPassword)
.authority(ROLE_USER)
.build())
);

String atk = tokenProvider.createAccessToken(account.getAccountId(), getAuthentication(account.getEmail(), "abc123"));
String atk = tokenProvider.createAccessToken(account.getAccountId(), getAuthentication(account.getEmail(), nonEncryptionPassword));

HttpHeaders headers = new HttpHeaders();
headers.setLocation(URI.create(appleRedirectUrl + atk +"&isRegister=" + optionalAccount.isPresent()));
Expand Down

0 comments on commit 11955a2

Please sign in to comment.