Change authentication request path #8

Merged
FatttSnake merged 4 commits from FatttSnake into dev 2023-10-10 15:47:29 +08:00
5 changed files with 3 additions and 16 deletions

View File

@@ -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/"]

View File

@@ -58,7 +58,7 @@ class SecurityConfig(
authorizeHttpRequests
// Allow anonymous access
.requestMatchers(
"/api/v*/login",
"/login",
"/error/thrown",
"/doc.html",
"/swagger-ui/**",

View File

@@ -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) {

View File

@@ -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 -> {

View File

@@ -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)
}
*/
}