feat: document login flow and update flow generation for login process
This commit is contained in:
parent
f3425c0cd5
commit
67958105a1
5 changed files with 11 additions and 3 deletions
6
apps/infoalloggi/docs/flows/login.md
Normal file
6
apps/infoalloggi/docs/flows/login.md
Normal 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")
|
||||||
|
```
|
||||||
|
|
@ -144,14 +144,14 @@ function main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
nextSteps.forEach((next) => {
|
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);
|
connections.add(link);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Handle single-node flows (start node with no connections)
|
// Handle single-node flows (start node with no connections)
|
||||||
if (connections.size === 0 && sorted.length > 0 && sorted[0]) {
|
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 {
|
} else {
|
||||||
connections.forEach((c) => mermaid.push(c));
|
connections.forEach((c) => mermaid.push(c));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ export const FormLogin = () => {
|
||||||
toast.error(`${t.auth.login.fail}\n${message}`);
|
toast.error(`${t.auth.login.fail}\n${message}`);
|
||||||
},
|
},
|
||||||
onSuccess: async (data) => {
|
onSuccess: async (data) => {
|
||||||
|
// FLOWS: login | 3 | Login Result Handling
|
||||||
switch (data.status) {
|
switch (data.status) {
|
||||||
case "not-found":
|
case "not-found":
|
||||||
setUserNotFound(true);
|
setUserNotFound(true);
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import { useTranslation } from "~/providers/I18nProvider";
|
||||||
*/
|
*/
|
||||||
const LoginPage: NextPage = () => {
|
const LoginPage: NextPage = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
// FLOWS: login | 1 | Login Page
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Head>
|
<Head>
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@ export const createUserAdmin = async ({
|
||||||
return { status: "success" as const };
|
return { status: "success" as const };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// FLOWS: login | 2 | Login function
|
||||||
export const logIn = async ({
|
export const logIn = async ({
|
||||||
email,
|
email,
|
||||||
password,
|
password,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue