forked from Archives/Athou_commafeed
validate password in the frontend too (#2017)
This commit is contained in:
@@ -49,4 +49,7 @@ public class ServerInfo implements Serializable {
|
||||
@Schema(required = true)
|
||||
private boolean initialSetupRequired;
|
||||
|
||||
@Schema(required = true)
|
||||
private int minimumPasswordLength;
|
||||
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ public class ServerREST {
|
||||
infos.setTreeReloadInterval(config.websocket().treeReloadInterval().toMillis());
|
||||
infos.setForceRefreshCooldownDuration(config.feedRefresh().forceRefreshCooldownDuration().toMillis());
|
||||
infos.setInitialSetupRequired(databaseStartupService.isInitialSetupRequired());
|
||||
infos.setMinimumPasswordLength(config.users().minimumPasswordLength());
|
||||
return infos;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import com.commafeed.TestConstants;
|
||||
import com.microsoft.playwright.BrowserContext;
|
||||
import com.microsoft.playwright.Locator;
|
||||
import com.microsoft.playwright.Page;
|
||||
import com.microsoft.playwright.assertions.PlaywrightAssertions;
|
||||
import com.microsoft.playwright.options.AriaRole;
|
||||
@@ -48,17 +47,6 @@ class AuthentificationIT {
|
||||
PlaywrightAssertions.assertThat(page).hasURL("http://localhost:8085/#/app/category/all");
|
||||
}
|
||||
|
||||
@Test
|
||||
void registerFailPasswordTooSimple() {
|
||||
Page page = context.newPage();
|
||||
page.navigate(getLoginPageUrl());
|
||||
page.getByText("Sign up!").click();
|
||||
PlaywrightTestUtils.register(page, "user", "user@domain.com", "p");
|
||||
|
||||
Locator alert = page.getByRole(AriaRole.ALERT);
|
||||
PlaywrightAssertions.assertThat(alert).containsText("Password must be 4 or more characters in length.");
|
||||
}
|
||||
|
||||
@Test
|
||||
void registerSuccess() {
|
||||
Page page = context.newPage();
|
||||
|
||||
@@ -22,6 +22,7 @@ class ServerIT extends BaseIT {
|
||||
Assertions.assertEquals(900000, serverInfos.getWebsocketPingInterval());
|
||||
Assertions.assertEquals(30000, serverInfos.getTreeReloadInterval());
|
||||
Assertions.assertEquals(60000, serverInfos.getForceRefreshCooldownDuration());
|
||||
Assertions.assertEquals(4, serverInfos.getMinimumPasswordLength());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user