diff --git a/application/src/main/java/run/halo/app/plugin/SharedApplicationContextFactory.java b/application/src/main/java/run/halo/app/plugin/SharedApplicationContextFactory.java index 16da32adbe..e8e23316c7 100644 --- a/application/src/main/java/run/halo/app/plugin/SharedApplicationContextFactory.java +++ b/application/src/main/java/run/halo/app/plugin/SharedApplicationContextFactory.java @@ -4,6 +4,7 @@ import org.springframework.cache.CacheManager; import org.springframework.context.ApplicationContext; import org.springframework.context.support.GenericApplicationContext; +import org.springframework.security.core.userdetails.ReactiveUserDetailsService; import org.springframework.security.web.server.context.ServerSecurityContextRepository; import org.springframework.security.web.server.savedrequest.ServerRequestCache; import run.halo.app.content.PostContentService; @@ -92,6 +93,10 @@ public static ApplicationContext create(ApplicationContext rootContext) { .ifUnique(userService -> beanFactory.registerSingleton("userService", userService)); rootContext.getBeanProvider(RoleService.class) .ifUnique(roleService -> beanFactory.registerSingleton("roleService", roleService)); + rootContext.getBeanProvider(ReactiveUserDetailsService.class) + .ifUnique(userDetailsService -> + beanFactory.registerSingleton("userDetailsService", userDetailsService) + ); // TODO add more shared instance here sharedContext.refresh();