feat(ui): integrate login with shared auth shell

This commit is contained in:
sechmachine
2026-08-15 01:04:25 +07:00
parent 906ec6bea4
commit f48fc63775
4 changed files with 49 additions and 20 deletions
@@ -49,6 +49,20 @@ class AccountTemplateIntegrationTest {
.andExpect(content().string(containsString("href=\"/assets/app.css\"")));
}
@Test
void loginUsesPublicAuthShellAndPreservesAuthenticationContract() throws Exception {
mvc.perform(get("/template-contract/accounts/login")
.param("error", "")
.with(user("anonymous-template-viewer")))
.andExpect(status().isOk())
.andExpect(content().string(containsString("class=\"auth-shell\"")))
.andExpect(content().string(containsString("action=\"/login\"")))
.andExpect(content().string(containsString("name=\"username\"")))
.andExpect(content().string(containsString("autocomplete=\"current-password\"")))
.andExpect(content().string(containsString("role=\"alert\"")))
.andExpect(content().string(containsString("src=\"/assets/theme.js\"")));
}
@Controller
public static class TemplateController {
@@ -62,5 +76,10 @@ class AccountTemplateIntegrationTest {
model.addAttribute("token", "raw-token");
return "accounts/activate";
}
@GetMapping("/template-contract/accounts/login")
String login() {
return "accounts/login";
}
}
}