diff --git a/src/main/java/solitour_backend/solitour/auth/service/OauthService.java b/src/main/java/solitour_backend/solitour/auth/service/OauthService.java index d1f530b..55d6cb3 100644 --- a/src/main/java/solitour_backend/solitour/auth/service/OauthService.java +++ b/src/main/java/solitour_backend/solitour/auth/service/OauthService.java @@ -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); @@ -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) { diff --git a/src/main/resources/schema.sql b/src/main/resources/schema.sql index 04f00eb..f4e92b0 100644 --- a/src/main/resources/schema.sql +++ b/src/main/resources/schema.sql @@ -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, @@ -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`),