WIP: XXX
This commit is contained in:
+2
-1
@@ -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"/>
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user