feat: document login flow and update flow generation for login process

This commit is contained in:
Marco Pedone 2026-03-27 18:49:13 +01:00
parent f3425c0cd5
commit 67958105a1
5 changed files with 11 additions and 3 deletions

View file

@ -0,0 +1,6 @@
```mermaid
graph TD
step_1("Login Page") --> step_2("Login function")
step_2("Login function") --> step_3("Login Result Handling")
```

View file

@ -144,14 +144,14 @@ function main() {
});
nextSteps.forEach((next) => {
const link = ` ${safeId(current.id)}["${current.label}"] --> ${safeId(next.id)}["${next.label}"]`;
const link = ` ${safeId(current.id)}("${current.label}") --> ${safeId(next.id)}("${next.label}")`;
connections.add(link);
});
});
// Handle single-node flows (start node with no connections)
if (connections.size === 0 && sorted.length > 0 && sorted[0]) {
mermaid.push(` ${safeId(sorted[0].id)}["${sorted[0].label}"]`);
mermaid.push(` ${safeId(sorted[0].id)}("${sorted[0].label}")`);
} else {
connections.forEach((c) => mermaid.push(c));
}

View file

@ -50,6 +50,7 @@ export const FormLogin = () => {
toast.error(`${t.auth.login.fail}\n${message}`);
},
onSuccess: async (data) => {
// FLOWS: login | 3 | Login Result Handling
switch (data.status) {
case "not-found":
setUserNotFound(true);

View file

@ -8,7 +8,7 @@ import { useTranslation } from "~/providers/I18nProvider";
*/
const LoginPage: NextPage = () => {
const { t } = useTranslation();
// FLOWS: login | 1 | Login Page
return (
<>
<Head>

View file

@ -67,6 +67,7 @@ export const createUserAdmin = async ({
return { status: "success" as const };
};
// FLOWS: login | 2 | Login function
export const logIn = async ({
email,
password,