feat(auth): implement JWT authentication
- Add JwtUtils for token generation and validation using jjwt - Refactor AuthService.login to return User instead of Boolean - Add jjwt dependencies and integrate JWT into login flow - Externalize JWT secret, expiration, and log level as configurable env vars with defaults
This commit is contained in:
@@ -9,8 +9,8 @@ spring:
|
||||
jackson:
|
||||
default-property-inclusion: non_null
|
||||
property-naming-strategy: SNAKE_CASE
|
||||
date-format: ${JSON_DATE_FORMAT}
|
||||
time-zone: ${JSON_TIME_ZONE}
|
||||
date-format: ${JSON_DATE_FORMAT:}
|
||||
time-zone: ${JSON_TIME_ZONE:}
|
||||
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
@@ -18,6 +18,10 @@ mybatis-plus:
|
||||
map-underscore-to-camel-case: true
|
||||
# 开启日志输出sql语句
|
||||
# log-impl: org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl
|
||||
# logging:
|
||||
# level:
|
||||
# com.msksbr.bookmgr: "DEBUG"
|
||||
logging:
|
||||
level:
|
||||
com.msksbr.bookmgr: ${LOG_LEVEL:INFO}
|
||||
|
||||
jwt:
|
||||
secret: ${JWT_SECRET:}
|
||||
expiration: ${JWT_EXPIRATION_TIME:86400000}
|
||||
Reference in New Issue
Block a user