Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into develop
  • Loading branch information
Astin01 committed Oct 12, 2024
2 parents 9a410c8 + 2d453e9 commit f2ee628
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,15 @@ private void checkUserStatus(User user) {
}
}

private void saveToken(KakaoTokenResponse tokenResponse, User user) {
Token token = Token.builder()
.user(user)
.oauthToken(tokenResponse.getRefreshToken())
.build();

tokenRepository.save(token);
}

private User saveGoogleUser(GoogleUserResponse response) {
String imageUrl = getGoogleUserImage(response);
UserImage savedUserImage = userImageService.saveUserImage(imageUrl);
Expand Down Expand Up @@ -337,7 +346,6 @@ private void deleteCookie(String name, String value, HttpServletResponse respons
response.addCookie(cookie);
}


public void revokeToken(String type, String token) throws IOException {
HttpStatusCode responseCode;
switch (type) {
Expand Down
5 changes: 2 additions & 3 deletions src/main/resources/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ DROP TABLE IF EXISTS `user_image`;
DROP TABLE IF EXISTS `diary_day_content`;
DROP TABLE IF EXISTS `diary`;


CREATE TABLE `user_image`
(
`user_image_id` BIGINT NOT NULL AUTO_INCREMENT,
Expand Down Expand Up @@ -57,8 +56,8 @@ CREATE TABLE `user`

CREATE TABLE `token`
(
`token_id` BIGINT NOT NULL AUTO_INCREMENT,
`user_id` BIGINT NOT NULL,
`token_id` BIGINT NOT NULL AUTO_INCREMENT,
`user_id` BIGINT NOT NULL,
`refresh_token` VARCHAR(250) NULL,
`oauth_token` VARCHAR(250) NULL,
CONSTRAINT PK_TOKEN PRIMARY KEY (`token_id`),
Expand Down

0 comments on commit f2ee628

Please sign in to comment.