This commit is contained in:
2026-04-30 18:53:06 +08:00
parent 2adefb5207
commit 388a34837f
4 changed files with 14 additions and 7 deletions
@@ -98,7 +98,8 @@ public class WebSecurityConfig {
http.authorizeHttpRequests(auth -> {
// Publicly accessible
auth.requestMatchers(
"/login/**", "/initUserData",
"/login/**", "/register", "/registerDo", "/initUserData",
"/", "/main", "/index", "/getdiscussionsbyid",
// SpringDoc OpenAPI UI and spec endpoint (developer tools, no sensitive data)
"/swagger-ui/**", "/swagger-ui.html", "/v3/api-docs/**"
).permitAll();
@@ -73,6 +73,3 @@ public class RestUserController {
return usersService.getAllList();
}
}
}
+5 -3
View File
@@ -5,9 +5,10 @@
spring:
jpa:
show-sql: true
# Flyway owns DDL; Hibernate only validates existing schema
# Flyway owns DDL. Disable Hibernate validation in H2 because H2 reports
# some MySQL-compatible legacy column types differently from MySQL/Hibernate.
hibernate:
ddl-auto: validate
ddl-auto: none
# H2 uses the same SQL dialect as MySQL in MySQL compatibility mode
# H2 console — enabled in dev ONLY.
@@ -22,7 +23,8 @@ spring:
web-allow-others: false
datasource:
url: jdbc:h2:~/testjiscuss;MODE=MySQL;NON_KEYWORDS=VALUE
# H2 2.x reserves USER/VALUE; keep them usable for the legacy schema names.
url: jdbc:h2:~/testjiscuss;MODE=MySQL;NON_KEYWORDS=VALUE,USER
username: sa
password:
driver-class-name: org.h2.Driver
@@ -0,0 +1,7 @@
-- Reset development seed account passwords to a known BCrypt value.
-- Plaintext password for both seeded accounts: 123456
-- Do not use these credentials in production.
UPDATE user
SET password = '$2a$10$R4prDK/CfI0Hjrcz5dS8cOHClOIHIHlk8SoGmVY1iGWYSPxBGo7nm'
WHERE username IN ('admin', 'test');