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) => {
|
||||
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));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import { useTranslation } from "~/providers/I18nProvider";
|
|||
*/
|
||||
const LoginPage: NextPage = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
// FLOWS: login | 1 | Login Page
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ export const createUserAdmin = async ({
|
|||
return { status: "success" as const };
|
||||
};
|
||||
|
||||
// FLOWS: login | 2 | Login function
|
||||
export const logIn = async ({
|
||||
email,
|
||||
password,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue