change error messages

This commit is contained in:
Max Peintner
2025-01-03 11:33:14 +01:00
parent f1b8235633
commit 41d8ab9bd9
7 changed files with 9 additions and 9 deletions

View File

@@ -8,5 +8,5 @@ export async function loginnameScreen(page: Page, username: string) {
export async function loginnameScreenExpect(page: Page, username: string) { export async function loginnameScreenExpect(page: Page, username: string) {
await expect(page.getByTestId(usernameTextInput)).toHaveValue(username); await expect(page.getByTestId(usernameTextInput)).toHaveValue(username);
await expect(page.getByTestId("error").locator("div")).toContainText("Could not find user"); await expect(page.getByTestId("error").locator("div")).toContainText("User not found in the system");
} }

View File

@@ -44,7 +44,7 @@ export default async function Page(props: { searchParams: Promise<any> }) {
authRequestId, authRequestId,
}).catch((error) => { }).catch((error) => {
console.error("Could not resend verification email", error); console.error("Could not resend verification email", error);
throw Error("Could not request email"); throw Error("Failed to send verification email");
}); });
} }
} else if ("userId" in searchParams && userId) { } else if ("userId" in searchParams && userId) {
@@ -54,7 +54,7 @@ export default async function Page(props: { searchParams: Promise<any> }) {
authRequestId, authRequestId,
}).catch((error) => { }).catch((error) => {
console.error("Could not resend verification email", error); console.error("Could not resend verification email", error);
throw Error("Could not request email"); throw Error("Failed to send verification email");
}); });
} }

View File

@@ -62,7 +62,7 @@ export async function createNewSessionFromIdpIntent(
const userResponse = await getUserByID(command.userId); const userResponse = await getUserByID(command.userId);
if (!userResponse || !userResponse.user) { if (!userResponse || !userResponse.user) {
return { error: "Could not find user" }; return { error: "User not found in the system" };
} }
const loginSettings = await getLoginSettings( const loginSettings = await getLoginSettings(

View File

@@ -310,7 +310,7 @@ export async function sendLoginname(command: SendLoginnameCommand) {
if (resp) { if (resp) {
return resp; return resp;
} }
return { error: "Could not find user" }; return { error: "User not found in the system" };
} else if ( } else if (
loginSettings?.allowRegister && loginSettings?.allowRegister &&
loginSettings?.allowUsernamePassword loginSettings?.allowUsernamePassword
@@ -371,5 +371,5 @@ export async function sendLoginname(command: SendLoginnameCommand) {
// fallbackToPassword // fallbackToPassword
return { error: "Could not find user" }; return { error: "User not found in the system" };
} }

View File

@@ -167,7 +167,7 @@ export async function sendPasskey(command: SendPasskeyCommand) {
const userResponse = await getUserByID(session?.factors?.user?.id); const userResponse = await getUserByID(session?.factors?.user?.id);
if (!userResponse.user) { if (!userResponse.user) {
return { error: "Could not find user" }; return { error: "User not found in the system" };
} }
const humanUser = const humanUser =

View File

@@ -123,7 +123,7 @@ export async function sendPassword(command: UpdateSessionCommand) {
const userResponse = await getUserByID(session?.factors?.user?.id); const userResponse = await getUserByID(session?.factors?.user?.id);
if (!userResponse.user) { if (!userResponse.user) {
return { error: "Could not find user" }; return { error: "User not found in the system" };
} }
user = userResponse.user; user = userResponse.user;

View File

@@ -79,7 +79,7 @@ export async function registerUser(command: RegisterUserCommand) {
const userResponse = await getUserByID(session?.factors?.user?.id); const userResponse = await getUserByID(session?.factors?.user?.id);
if (!userResponse.user) { if (!userResponse.user) {
return { error: "Could not find user" }; return { error: "User not found in the system" };
} }
const humanUser = const humanUser =