Skip to content

Commit 168d402

Browse files
committed
chore: удалить файл postman-collection.json из документации
1 parent 737e97b commit 168d402

5 files changed

Lines changed: 590 additions & 1175 deletions

File tree

README.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,4 @@
104104

105105
## Лицензия
106106

107-
Этот проект лицензирован под **MIT License** - подробности в файле [LICENSE](LICENSE).
108-
109-
---
110-
111-
<div align="center">
112-
113-
**StackScout Team**
114-
Сделано с любовью, Java и Next.js
115-
116-
</div>
107+
Этот проект лицензирован под **MIT License** - подробности в файле [LICENSE](LICENSE).

backend/src/main/java/com/stackscout/config/JwtAuthenticationFilter.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,17 @@ protected void doFilterInternal(
3737
filterChain.doFilter(request, response);
3838
return;
3939
}
40-
jwt = authHeader.substring(7);
41-
username = jwtService.extractUsername(jwt);
40+
jwt = authHeader.substring(7).trim();
41+
if (jwt.isEmpty()) {
42+
filterChain.doFilter(request, response);
43+
return;
44+
}
45+
try {
46+
username = jwtService.extractUsername(jwt);
47+
} catch (RuntimeException ex) {
48+
filterChain.doFilter(request, response);
49+
return;
50+
}
4251
if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) {
4352
UserDetails userDetails = this.userDetailsService.loadUserByUsername(username);
4453
if (jwtService.isTokenValid(jwt, userDetails)) {

backend/src/main/java/com/stackscout/config/SecurityConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
4848
.csrf(csrf -> csrf.disable())
4949
.authorizeHttpRequests(auth -> auth
5050
.requestMatchers("/api/v1/auth/**").permitAll()
51+
.requestMatchers("/api/v1/health", "/api/v1/ping").permitAll()
5152
.requestMatchers("/api/v1/libraries/**").permitAll()
5253
.requestMatchers("/swagger-ui/**", "/v3/api-docs/**", "/swagger-ui.html").permitAll()
5354
.requestMatchers("/h2-console/**").permitAll()

0 commit comments

Comments
 (0)