This commit is contained in:
aditya.chandel
2025-02-16 21:14:59 -07:00
parent 80681e1757
commit 5d35c09dd4
3 changed files with 4 additions and 3 deletions
@@ -32,11 +32,12 @@ public class SecurityConfig {
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http
.cors(cors -> cors.configurationSource(corsConfigurationSource())) // Enable CORS
.cors(cors -> cors.configurationSource(corsConfigurationSource()))
.csrf(AbstractHttpConfigurer::disable)
.authorizeHttpRequests(auth -> auth
.requestMatchers("/api/v1/auth/register", "/api/v1/auth/login").permitAll()
.requestMatchers("/ws/**").permitAll()
.requestMatchers("/api/v1/books/*/cover").permitAll()
.anyRequest().authenticated()
)
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
@@ -4,7 +4,7 @@
(mouseout)="isHovered = false">
<div class="cover-container">
<img
[attr.src]="urlHelper.getCoverUrl(book.id, book.metadata?.coverUpdatedOn) | secure | async"
[src]="urlHelper.getCoverUrl(book.id, book.metadata?.coverUpdatedOn)"
class="book-cover placeholder"
alt="Cover of {{ book.metadata?.title }}"
loading="lazy"/>
+1 -1
View File
@@ -54,7 +54,7 @@ export class UserService {
fetchUser(userId: number): void {
this.http.get<User>(`${this.userUrl}/${userId}`).subscribe(user => {
this.userDataSubject.next(user);
this.startWebSocket(); // Start WebSocket after user data is loaded
this.startWebSocket();
});
}