Skip to content

Commit

Permalink
Merge pull request #69 from AI-SIP/develop
Browse files Browse the repository at this point in the history
feat: default 요청 경로를 /home으로 수정
  • Loading branch information
KiSeungMin authored Nov 5, 2024
2 parents 387e3e8 + deee10a commit ac14d0f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
9 changes: 1 addition & 8 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,7 @@
- [ ] 문서 수정
<br>

### 반영 브랜치
- [ ] feat ➡️ dev
- [ ] dev ➡️ main
<br>

### 작업 사항
#### 📝`작업 내용`
작업 내용 상세 설명
#### 📝`작업 내용`
작업 내용 상세 설명

<br>
13 changes: 11 additions & 2 deletions src/main/java/com/aisip/OnO/backend/Auth/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;

Expand All @@ -35,9 +36,17 @@ public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}

@Bean
public AuthenticationEntryPoint authenticationEntryPoint() {
return (request, response, authException) -> response.sendRedirect("/home");
}

@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http.cors().and().csrf().disable()
http.exceptionHandling()
.authenticationEntryPoint(authenticationEntryPoint())
.and()
.cors().and().csrf().disable()
.authorizeHttpRequests(authorizeRequests ->
authorizeRequests
.requestMatchers("/", "/home","/images/**", "/api/auth/**", "/login", "/css/**", "/js/**").permitAll()
Expand All @@ -56,7 +65,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
response.sendRedirect("/admin/main"); // 성공 후 관리자 페이지로 이동
})
.failureHandler((request, response, exception) -> {
response.sendRedirect("/login?error");
response.sendRedirect("/login?error");
})
.permitAll()
)
Expand Down

0 comments on commit ac14d0f

Please sign in to comment.