Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor authentication flow and enhance events handling
- **SupabaseAutoConfiguration.kt**: - Added `SupabaseJwtVerifier` bean import and `ApplicationEventPublisher` bean injection. - Updated `supabaseJwtVerifier` bean to return `SupabaseJwtVerifier`. - Injected `applicationEventPublisher` in `SupabaseUserService`. - **SupabaseUserServiceGoTrueImpl.kt**: - Added new event classes for user events. - Refactored `loginWithEmail` to use `authenticateWithCurrentSession`. - Added methods for anonymous sign-in and linking anonymous to identity. - Implemented `authenticateWithCurrentSession` and `authenticate` methods. - **SupabaseUserService.kt**: - Renamed `authorizeWithJwtOrResetPassword` to `handleClientAuthentication`. - Added methods for anonymous sign-in, linking anonymous to identity, and authentication. - **SupabaseUser.kt**: - Updated to parse JWT and handle user metadata, roles, and provider. - **ExampleWebController.kt**: - Removed unused `dataSource` and `jdbc` method. - **SupabaseJwtFilter.kt**: - Removed direct authentication logic and delegated to `SupabaseUserService`. - **SupabaseSecurityConfig.kt**: - Updated `supabaseAuthenticationProvider` to use `SupabaseJwtVerifier`. - Modified `supabaseJwtFilter` to inject `SupabaseUserService`. - **SupabaseAuthenticationProvider.kt**: - Updated to use `SupabaseJwtVerifier` for authentication. - **SupabaseAuthenticationEntryPoint.kt**: - Added handling for `HX-Request` header to redirect unauthenticated requests. - **Templates**: - Updated Thymeleaf template syntax for script blocks. - Added `hx-target` for response element in `updatePassword.html`.
- Loading branch information