Skip to content

Commit

Permalink
๐Ÿš€ [Deploy] - ๋””์Šค์ฝ”๋“œ ์†Œ์…œ ๋กœ๊ทธ์ธ ์ด์Šˆ ํ•ด๊ฒฐ ๋ฐ˜์˜ (#210)
Browse files Browse the repository at this point in the history
* ๐Ÿ› [Fix] - Discord ์†Œ์…œ ๋กœ๊ทธ์ธ ์ „ํ™˜ nickname ์ด์Šˆ ํ•ด๊ฒฐ (#205)

* refactor: ์ฝ”๋“œ ์Šคํƒ€์ผ ์ˆ˜์ •

* fix: Work ์ƒ์„ฑ ๋‚ ์งœ ๊ธฐ์ค€์œผ๋กœ ๋‚ด๋ฆผ์ฐจ์ˆœ ์„ค์ •

* fix: PeerReview์ผ ๊ฒฝ์šฐ ์ถ”๊ฐ€

* Chore: ํ”„๋กœ์ ํŠธ readme ๊พธ๋ฏธ๊ธฐ

* chore: README ์ˆ˜์ •

* Fix: ๋กœ๊ทธ์•„์›ƒ ์‹œ, ์ฟ ํ‚ค ์‚ญ์ œ ์ฝ”๋“œ ์ˆ˜์ •

* Refactor: ํ•„์š”์—†๋Š” ์ฝ”๋“œ ์‚ญ์ œ

* !HOTFIX: ๋ช…๋ น์–ด ์ด๋ฆ„ ์ˆ˜์ •์— ๋”ฐ๋ฅธ listener ์ฝ”๋“œ ์ˆ˜์ •

* Chore: DB ์ •๋ณด ์ˆ˜์ •

* Fix: JDA ๋กœ๊ทธ ์ •๋ณด ๊ธฐ๋ก ์ถ”๊ฐ€

* Chore: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ Credentials ์ถ”๊ฐ€

* Feat: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ ๊ตฌํ˜„

* Feat: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ ๊ตฌํ˜„

* Chore: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ Credentials ์ถ”๊ฐ€

* Chore: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ Credentials ์ถ”๊ฐ€

* Chore: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ Credentials ์ถ”๊ฐ€

* Chore: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ Credentials ์ถ”๊ฐ€

* Fix: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ ์ „ํ™˜ ์ค‘ ์ƒ๊ธด ์ด์Šˆ ํ•ด๊ฒฐ

* Fix: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ ์ „ํ™˜
 ์ค‘ ์ƒ๊ธด ์ด์Šˆ ํ•ด๊ฒฐ

* ๐Ÿ› [Fix] - Discord ์†Œ์…œ ๋กœ๊ทธ์ธ ์ „ํ™˜ (#207)

* refactor: ์ฝ”๋“œ ์Šคํƒ€์ผ ์ˆ˜์ •

* fix: Work ์ƒ์„ฑ ๋‚ ์งœ ๊ธฐ์ค€์œผ๋กœ ๋‚ด๋ฆผ์ฐจ์ˆœ ์„ค์ •

* fix: PeerReview์ผ ๊ฒฝ์šฐ ์ถ”๊ฐ€

* Chore: ํ”„๋กœ์ ํŠธ readme ๊พธ๋ฏธ๊ธฐ

* chore: README ์ˆ˜์ •

* Fix: ๋กœ๊ทธ์•„์›ƒ ์‹œ, ์ฟ ํ‚ค ์‚ญ์ œ ์ฝ”๋“œ ์ˆ˜์ •

* Refactor: ํ•„์š”์—†๋Š” ์ฝ”๋“œ ์‚ญ์ œ

* !HOTFIX: ๋ช…๋ น์–ด ์ด๋ฆ„ ์ˆ˜์ •์— ๋”ฐ๋ฅธ listener ์ฝ”๋“œ ์ˆ˜์ •

* Chore: DB ์ •๋ณด ์ˆ˜์ •

* Fix: JDA ๋กœ๊ทธ ์ •๋ณด ๊ธฐ๋ก ์ถ”๊ฐ€

* Chore: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ Credentials ์ถ”๊ฐ€

* Feat: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ ๊ตฌํ˜„

* Feat: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ ๊ตฌํ˜„

* Chore: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ Credentials ์ถ”๊ฐ€

* Chore: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ Credentials ์ถ”๊ฐ€

* Chore: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ Credentials ์ถ”๊ฐ€

* Chore: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ Credentials ์ถ”๊ฐ€

* Fix: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ ์ „ํ™˜ ์ค‘ ์ƒ๊ธด ์ด์Šˆ ํ•ด๊ฒฐ

* Fix: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ ์ „ํ™˜
 ์ค‘ ์ƒ๊ธด ์ด์Šˆ ํ•ด๊ฒฐ

* Fix: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ ์ „ํ™˜
 ์ค‘ ์ƒ๊ธด ์ด์Šˆ ํ•ด๊ฒฐ

* ๐Ÿ› [Fix] - Discord ์†Œ์…œ ๋กœ๊ทธ์ธ ์ „ํ™˜ nickname ์ด์Šˆ ํ•ด๊ฒฐ #51 (#209)

* refactor: ์ฝ”๋“œ ์Šคํƒ€์ผ ์ˆ˜์ •

* fix: Work ์ƒ์„ฑ ๋‚ ์งœ ๊ธฐ์ค€์œผ๋กœ ๋‚ด๋ฆผ์ฐจ์ˆœ ์„ค์ •

* fix: PeerReview์ผ ๊ฒฝ์šฐ ์ถ”๊ฐ€

* Chore: ํ”„๋กœ์ ํŠธ readme ๊พธ๋ฏธ๊ธฐ

* chore: README ์ˆ˜์ •

* Fix: ๋กœ๊ทธ์•„์›ƒ ์‹œ, ์ฟ ํ‚ค ์‚ญ์ œ ์ฝ”๋“œ ์ˆ˜์ •

* Refactor: ํ•„์š”์—†๋Š” ์ฝ”๋“œ ์‚ญ์ œ

* !HOTFIX: ๋ช…๋ น์–ด ์ด๋ฆ„ ์ˆ˜์ •์— ๋”ฐ๋ฅธ listener ์ฝ”๋“œ ์ˆ˜์ •

* Chore: DB ์ •๋ณด ์ˆ˜์ •

* Fix: JDA ๋กœ๊ทธ ์ •๋ณด ๊ธฐ๋ก ์ถ”๊ฐ€

* Chore: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ Credentials ์ถ”๊ฐ€

* Feat: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ ๊ตฌํ˜„

* Feat: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ ๊ตฌํ˜„

* Chore: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ Credentials ์ถ”๊ฐ€

* Chore: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ Credentials ์ถ”๊ฐ€

* Chore: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ Credentials ์ถ”๊ฐ€

* Chore: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ Credentials ์ถ”๊ฐ€

* Fix: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ ์ „ํ™˜ ์ค‘ ์ƒ๊ธด ์ด์Šˆ ํ•ด๊ฒฐ

* Fix: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ ์ „ํ™˜
 ์ค‘ ์ƒ๊ธด ์ด์Šˆ ํ•ด๊ฒฐ

* Fix: Discord ์†Œ์…œ ๋กœ๊ทธ์ธ ์ „ํ™˜
 ์ค‘ ์ƒ๊ธด ์ด์Šˆ ํ•ด๊ฒฐ

* Chore: ํ”„๋ก ํŠธ์—”๋“œ redirect url ์ˆ˜์ •

* Fix: ๋””์Šค์ฝ”๋“œ ์†Œ์…œ ๋กœ๊ทธ์ธ ์ด์Šˆ ํ•ด๊ฒฐ
  • Loading branch information
JeongHeumChoi authored Jul 23, 2024
1 parent 3f28f74 commit 0cb40b3
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public class User {
private EProvider provider;

/* ์‚ฌ์šฉ์ž ์ด์šฉ ์ •๋ณด */
@Column(name = "nickname", nullable = false)
@Column(name = "nickname")
private String nickname;
@Column(name = "profile_image", nullable = false)
@Column(name = "profile_image")
@Enumerated(EnumType.STRING)
private EProfileImage profileImage;
@Column(name = "refresh_Token")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public interface UserRepository extends JpaRepository<User, Long> {
Optional<User> findById(Long userId);
Optional<User> findBySerialId(String serialId);
boolean existsBySerialId(String serialId);
boolean existsByIdAndNicknameIsNull(Long id);

interface UserSecurityForm {
Long getId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ public class SecurityConfig {

private final JwtUtil jwtUtil;
private final JwtAuthenticationManager jwtAuthenticationManager;
private final DefaultSuccessHandler defaultSuccessHandler;
private final DefaultFailureHandler defaultFailureHandler;
private final Oauth2SuccessHandler oauth2SuccessHandler;
private final Oauth2FailureHandler oauth2FailureHandler;
private final CustomOauth2UserDetailService customOauth2UserDetailService;
Expand All @@ -50,20 +48,10 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
)
.authorizeHttpRequests(request ->
request
.requestMatchers("/login").permitAll()
.requestMatchers("/api/auth/**").permitAll()
.requestMatchers("/api/oauth2/sign-up").permitAll()
.requestMatchers("/api/**").hasAnyRole("USER")
.anyRequest().authenticated()
)
.formLogin(login -> login
.loginPage("/login")
.loginProcessingUrl("/api/auth/sign-in")
.usernameParameter("serial_id")
.passwordParameter("password")
.successHandler(defaultSuccessHandler)
.failureHandler(defaultFailureHandler)
)
.oauth2Login(login -> login
.successHandler(oauth2SuccessHandler)
.failureHandler(oauth2FailureHandler)
Expand All @@ -84,7 +72,6 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.addFilterBefore(
new JwtExceptionFilter(), JwtAuthenticationFilter.class
)

.getOrBuild();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
import org.springframework.stereotype.Component;

import java.io.IOException;

@Slf4j
@Component
public class Oauth2FailureHandler implements AuthenticationFailureHandler {

Expand All @@ -20,6 +22,7 @@ public void onAuthenticationFailure(
HttpServletResponse response,
AuthenticationException exception
) throws IOException, ServletException {
log.info("์†Œ์…œ ๋กœ๊ทธ์ธ ์‹คํŒจ");
AuthenticationResponse.makeFailureResponse(response, ErrorCode.INTERNAL_SERVER_ERROR);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ public class Oauth2SuccessHandler implements AuthenticationSuccessHandler {

@Value("${server.domain}")
private String domain;

@Value("${server.sign-up-redirect-url}")
private String signUpRedirectUrl;

@Value("${server.home-redirect-url}")
private String homeRedirectUrl;

private final JwtUtil jwtUtil;
private final UserRepository userRepository;

Expand All @@ -40,6 +47,9 @@ public void onAuthenticationSuccess(

AuthenticationResponse.makeLoginSuccessResponse(response, domain, jwtTokenDto, jwtUtil.getRefreshExpiration());

response.sendRedirect("https://" + domain);
if (userRepository.existsByIdAndNicknameIsNull(principal.getUserId()))
response.sendRedirect(signUpRedirectUrl); // ์ตœ์ดˆ ๋กœ๊ทธ์ธ
else
response.sendRedirect(homeRedirectUrl);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class CustomOauth2UserDetailService extends DefaultOAuth2UserService {
public OAuth2User loadUser(
OAuth2UserRequest userRequest
) throws OAuth2AuthenticationException {
log.info("Oauth2UserRequest ์ง„์ž…, userRequest = {}", userRequest);
// provider ๊ฐ€์ ธ์˜ค๊ธฐ
EProvider provider = EProvider.valueOf(
userRequest.getClientRegistration().getRegistrationId().toUpperCase()
Expand Down
2 changes: 1 addition & 1 deletion startup-valley-properties

0 comments on commit 0cb40b3

Please sign in to comment.