Generate only one login link

This commit is contained in:
René Pfeuffer
2018-10-01 13:02:34 +02:00
parent 2c5fdd6b41
commit d4237b1fe9
2 changed files with 2 additions and 6 deletions

View File

@@ -39,10 +39,7 @@ public class IndexDtoGenerator {
}
builder.single(link("repositories", resourceLinks.repositoryCollection().self()));
} else {
builder.single(
link("formLogin", resourceLinks.authentication().formLogin()),
link("jsonLogin", resourceLinks.authentication().jsonLogin())
);
builder.single(link("login", resourceLinks.authentication().jsonLogin()));
}
return new IndexDto(builder.build());

View File

@@ -22,8 +22,7 @@ public class IndexResourceTest {
public void shouldRenderLoginUrlsForUnauthenticatedRequest() {
IndexDto index = indexResource.getIndex();
Assertions.assertThat(index.getLinks().getLinkBy("formLogin")).matches(Optional::isPresent);
Assertions.assertThat(index.getLinks().getLinkBy("jsonLogin")).matches(Optional::isPresent);
Assertions.assertThat(index.getLinks().getLinkBy("login")).matches(Optional::isPresent);
}
@Test