mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 16:05:44 +01:00
Generate only one login link
This commit is contained in:
@@ -39,10 +39,7 @@ public class IndexDtoGenerator {
|
|||||||
}
|
}
|
||||||
builder.single(link("repositories", resourceLinks.repositoryCollection().self()));
|
builder.single(link("repositories", resourceLinks.repositoryCollection().self()));
|
||||||
} else {
|
} else {
|
||||||
builder.single(
|
builder.single(link("login", resourceLinks.authentication().jsonLogin()));
|
||||||
link("formLogin", resourceLinks.authentication().formLogin()),
|
|
||||||
link("jsonLogin", resourceLinks.authentication().jsonLogin())
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new IndexDto(builder.build());
|
return new IndexDto(builder.build());
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ public class IndexResourceTest {
|
|||||||
public void shouldRenderLoginUrlsForUnauthenticatedRequest() {
|
public void shouldRenderLoginUrlsForUnauthenticatedRequest() {
|
||||||
IndexDto index = indexResource.getIndex();
|
IndexDto index = indexResource.getIndex();
|
||||||
|
|
||||||
Assertions.assertThat(index.getLinks().getLinkBy("formLogin")).matches(Optional::isPresent);
|
Assertions.assertThat(index.getLinks().getLinkBy("login")).matches(Optional::isPresent);
|
||||||
Assertions.assertThat(index.getLinks().getLinkBy("jsonLogin")).matches(Optional::isPresent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user