Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

white page when compile jhipster generated app #11930

Open
frobs opened this issue Feb 16, 2025 · 4 comments · May be fixed by #11964
Open

white page when compile jhipster generated app #11930

frobs opened this issue Feb 16, 2025 · 4 comments · May be fixed by #11964

Comments

@frobs
Copy link

frobs commented Feb 16, 2025

Generated with Jhipster lite 1.28.0 from web
Maven and Angular
If i create a jar with ./mvnw clean package
Do java -jar xxxxx.jar
server is launched in port 8080 but white screen is showed
and a forbidden is also showed.
How can i package the application with maven into a jar with angular app running inside?
This is what is in the app I have created

Image

@murdos
Copy link
Contributor

murdos commented Feb 17, 2025

I've reproduced you error, it seems to be related to the spring-boot-jwt security configuration that forbids the load of the angular resources.

@murdos murdos added theme: security area: bug 🐛 Something isn't working and removed area: question ❓ labels Feb 17, 2025
@qmonmert
Copy link
Contributor

I also reproduce

@murdos
Copy link
Contributor

murdos commented Feb 20, 2025

The following change allow displaying the home page, but I'm not sure it's safe:

Index: src/main/java/com/mycompany/myapp/shared/authentication/infrastructure/primary/SecurityConfiguration.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/main/java/com/mycompany/myapp/shared/authentication/infrastructure/primary/SecurityConfiguration.java b/src/main/java/com/mycompany/myapp/shared/authentication/infrastructure/primary/SecurityConfiguration.java
--- a/src/main/java/com/mycompany/myapp/shared/authentication/infrastructure/primary/SecurityConfiguration.java	(revision 4be88832914529947a7f67b5707347a36830deab)
+++ b/src/main/java/com/mycompany/myapp/shared/authentication/infrastructure/primary/SecurityConfiguration.java	(date 1739825395557)
@@ -66,7 +66,7 @@
       .httpBasic(AbstractHttpConfigurer::disable)
       .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
       .authorizeHttpRequests(authz -> authz
-        .requestMatchers(antMatcher(HttpMethod.OPTIONS, "/**")).permitAll()
+        .requestMatchers(antMatcher("/**")).permitAll()
         .requestMatchers(antMatcher("/app/**")).permitAll()
         .requestMatchers(antMatcher("/i18n/**")).permitAll()
         .requestMatchers(antMatcher("/content/**")).permitAll()

@frobs
Copy link
Author

frobs commented Feb 22, 2025

I have made a PR with the solution, adding only the necessary paths for the SPA rendering.

#11955

@qmonmert qmonmert linked a pull request Feb 22, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants