Change authentication request path #8
@@ -10,4 +10,4 @@ COPY ${EXTRACTED}/snapshot-dependencies/ /
|
||||
RUN true
|
||||
COPY ${EXTRACTED}/application/ /
|
||||
|
||||
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher", "--spring.config.additional-location=file:data/", "${JAVA_OPTS}"]
|
||||
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher", "--spring.config.additional-location=file:data/"]
|
||||
@@ -58,7 +58,7 @@ class SecurityConfig(
|
||||
authorizeHttpRequests
|
||||
// Allow anonymous access
|
||||
.requestMatchers(
|
||||
"/api/v*/login",
|
||||
"/login",
|
||||
"/error/thrown",
|
||||
"/doc.html",
|
||||
"/swagger-ui/**",
|
||||
|
||||
@@ -14,8 +14,6 @@ import top.fatweb.api.service.permission.IAuthenticationService
|
||||
import top.fatweb.api.util.WebUtil
|
||||
|
||||
@Tag(name = "身份认证", description = "身份认证相关接口")
|
||||
@Suppress("MVCPathVariableInspection")
|
||||
@RequestMapping("/api/{apiVersion}")
|
||||
@ApiVersion(2)
|
||||
@RestController
|
||||
class AuthenticationController(val authenticationService: IAuthenticationService, val userConverter: UserConverter) {
|
||||
|
||||
@@ -40,7 +40,7 @@ class ExceptionHandler {
|
||||
|
||||
is InternalAuthenticationServiceException -> {
|
||||
log.debug(e.localizedMessage, e)
|
||||
ResponseResult.fail(ResponseCode.SYSTEM_USERNAME_NOT_FOUND, e.localizedMessage, null)
|
||||
ResponseResult.fail(ResponseCode.SYSTEM_USERNAME_NOT_FOUND, "Username not found", null)
|
||||
}
|
||||
|
||||
is BadCredentialsException -> {
|
||||
|
||||
@@ -20,15 +20,4 @@ class FatWebApiApplicationTests {
|
||||
val jwt = JwtUtil.createJwt("User")
|
||||
assertEquals("User", jwt?.let { JwtUtil.parseJwt(it).subject })
|
||||
}
|
||||
|
||||
/*
|
||||
@Test
|
||||
fun addUser(@Autowired userService: IUserService, @Autowired passwordEncoder: PasswordEncoder) {
|
||||
val username = "admin"
|
||||
val rawPassword = "admin"
|
||||
val encodedPassword = passwordEncoder.encode(rawPassword)
|
||||
val user = User(username, encodedPassword)
|
||||
userService.save(user)
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user