185 lines
12 KiB
Plaintext
185 lines
12 KiB
Plaintext
|
|
<mxfile host="65bd71144e">
|
||
|
|
<diagram id="auth-flow" name="Authentication Flow">
|
||
|
|
<mxGraphModel dx="1200" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1000" pageHeight="800" math="0" shadow="0">
|
||
|
|
<root>
|
||
|
|
<mxCell id="0"/>
|
||
|
|
<mxCell id="1" parent="0"/>
|
||
|
|
|
||
|
|
<!-- Title -->
|
||
|
|
<mxCell id="2" value="Admin Login - Authentication Flow" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=18;fontStyle=1" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="250" y="20" width="500" height="30" as="geometry"/>
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- Actors Header -->
|
||
|
|
<mxCell id="3" value="Admin" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;fontStyle=1" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="80" y="70" width="100" height="40" as="geometry"/>
|
||
|
|
</mxCell>
|
||
|
|
<mxCell id="4" value="Admin UI" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;fontStyle=1" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="240" y="70" width="100" height="40" as="geometry"/>
|
||
|
|
</mxCell>
|
||
|
|
<mxCell id="5" value="Admin API" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=12;fontStyle=1" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="400" y="70" width="100" height="40" as="geometry"/>
|
||
|
|
</mxCell>
|
||
|
|
<mxCell id="6" value="Database" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=12;fontStyle=1" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="560" y="70" width="100" height="40" as="geometry"/>
|
||
|
|
</mxCell>
|
||
|
|
<mxCell id="7" value="Audit Log" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;fontStyle=1" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="720" y="70" width="100" height="40" as="geometry"/>
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- Vertical Lines -->
|
||
|
|
<mxCell id="8" value="" style="endArrow=none;dashed=1;html=1;strokeWidth=2;strokeColor=#6c8ebf;" edge="1" parent="1">
|
||
|
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||
|
|
<mxPoint x="130" y="110" as="sourcePoint"/>
|
||
|
|
<mxPoint x="130" y="700" as="targetPoint"/>
|
||
|
|
</mxGeometry>
|
||
|
|
</mxCell>
|
||
|
|
<mxCell id="9" value="" style="endArrow=none;dashed=1;html=1;strokeWidth=2;strokeColor=#6c8ebf;" edge="1" parent="1">
|
||
|
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||
|
|
<mxPoint x="290" y="110" as="sourcePoint"/>
|
||
|
|
<mxPoint x="290" y="700" as="targetPoint"/>
|
||
|
|
</mxGeometry>
|
||
|
|
</mxCell>
|
||
|
|
<mxCell id="10" value="" style="endArrow=none;dashed=1;html=1;strokeWidth=2;strokeColor=#82b366;" edge="1" parent="1">
|
||
|
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||
|
|
<mxPoint x="450" y="110" as="sourcePoint"/>
|
||
|
|
<mxPoint x="450" y="700" as="targetPoint"/>
|
||
|
|
</mxGeometry>
|
||
|
|
</mxCell>
|
||
|
|
<mxCell id="11" value="" style="endArrow=none;dashed=1;html=1;strokeWidth=2;strokeColor=#9673a6;" edge="1" parent="1">
|
||
|
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||
|
|
<mxPoint x="610" y="110" as="sourcePoint"/>
|
||
|
|
<mxPoint x="610" y="700" as="targetPoint"/>
|
||
|
|
</mxGeometry>
|
||
|
|
</mxCell>
|
||
|
|
<mxCell id="12" value="" style="endArrow=none;dashed=1;html=1;strokeWidth=2;strokeColor=#d6b656;" edge="1" parent="1">
|
||
|
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||
|
|
<mxPoint x="770" y="110" as="sourcePoint"/>
|
||
|
|
<mxPoint x="770" y="700" as="targetPoint"/>
|
||
|
|
</mxGeometry>
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- Step 1 -->
|
||
|
|
<mxCell id="13" value="1. Enter username + password" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#6c8ebf;" edge="1" parent="1">
|
||
|
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||
|
|
<mxPoint x="130" y="150" as="sourcePoint"/>
|
||
|
|
<mxPoint x="290" y="150" as="targetPoint"/>
|
||
|
|
</mxGeometry>
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- Step 2 -->
|
||
|
|
<mxCell id="14" value="2. POST /api/auth/login" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#82b366;" edge="1" parent="1">
|
||
|
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||
|
|
<mxPoint x="290" y="190" as="sourcePoint"/>
|
||
|
|
<mxPoint x="450" y="190" as="targetPoint"/>
|
||
|
|
</mxGeometry>
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- Step 3 -->
|
||
|
|
<mxCell id="15" value="3. Query admin_users" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#9673a6;" edge="1" parent="1">
|
||
|
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||
|
|
<mxPoint x="450" y="230" as="sourcePoint"/>
|
||
|
|
<mxPoint x="610" y="230" as="targetPoint"/>
|
||
|
|
</mxGeometry>
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- Step 4 -->
|
||
|
|
<mxCell id="16" value="4. Return admin data" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#9673a6;dashed=1;" edge="1" parent="1">
|
||
|
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||
|
|
<mxPoint x="610" y="270" as="sourcePoint"/>
|
||
|
|
<mxPoint x="450" y="270" as="targetPoint"/>
|
||
|
|
</mxGeometry>
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- Step 5 -->
|
||
|
|
<mxCell id="17" value="5. Verify password hash" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=11" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="380" y="300" width="140" height="30" as="geometry"/>
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- Step 6 -->
|
||
|
|
<mxCell id="18" value="6. Generate JWT token" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=11" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="380" y="350" width="140" height="30" as="geometry"/>
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- Step 7 -->
|
||
|
|
<mxCell id="19" value="7. Update last_login" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#9673a6;" edge="1" parent="1">
|
||
|
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||
|
|
<mxPoint x="450" y="410" as="sourcePoint"/>
|
||
|
|
<mxPoint x="610" y="410" as="targetPoint"/>
|
||
|
|
</mxGeometry>
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- Step 8 -->
|
||
|
|
<mxCell id="20" value="8. Log login action" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#d6b656;" edge="1" parent="1">
|
||
|
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||
|
|
<mxPoint x="450" y="450" as="sourcePoint"/>
|
||
|
|
<mxPoint x="770" y="450" as="targetPoint"/>
|
||
|
|
</mxGeometry>
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- Step 9 -->
|
||
|
|
<mxCell id="21" value="9. Return token + admin data" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#82b366;dashed=1;" edge="1" parent="1">
|
||
|
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||
|
|
<mxPoint x="450" y="490" as="sourcePoint"/>
|
||
|
|
<mxPoint x="290" y="490" as="targetPoint"/>
|
||
|
|
</mxGeometry>
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- Step 10 -->
|
||
|
|
<mxCell id="22" value="10. Store token in localStorage" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=11" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="220" y="520" width="140" height="30" as="geometry"/>
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- Step 11 -->
|
||
|
|
<mxCell id="23" value="11. Redirect to dashboard" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#6c8ebf;dashed=1;" edge="1" parent="1">
|
||
|
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||
|
|
<mxPoint x="290" y="570" as="sourcePoint"/>
|
||
|
|
<mxPoint x="130" y="570" as="targetPoint"/>
|
||
|
|
</mxGeometry>
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- Success Box -->
|
||
|
|
<mxCell id="24" value="✓ SUCCESS" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=13;fontStyle=1" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="80" y="610" width="100" height="40" as="geometry"/>
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- Error Section -->
|
||
|
|
<mxCell id="25" value="ERROR PATH" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1;fontColor=#b85450;" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="80" y="680" width="150" height="25" as="geometry"/>
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- Error Arrow -->
|
||
|
|
<mxCell id="26" value="If password invalid → Return error" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#b85450;dashed=1;" edge="1" parent="1">
|
||
|
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||
|
|
<mxPoint x="450" y="720" as="sourcePoint"/>
|
||
|
|
<mxPoint x="290" y="720" as="targetPoint"/>
|
||
|
|
</mxGeometry>
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- Error Message -->
|
||
|
|
<mxCell id="27" value="Show error message" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#b85450;dashed=1;" edge="1" parent="1">
|
||
|
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||
|
|
<mxPoint x="290" y="750" as="sourcePoint"/>
|
||
|
|
<mxPoint x="130" y="750" as="targetPoint"/>
|
||
|
|
</mxGeometry>
|
||
|
|
</mxCell>
|
||
|
|
|
||
|
|
<!-- Legend -->
|
||
|
|
<mxCell id="28" value="Legend:" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="850" y="150" width="80" height="20" as="geometry"/>
|
||
|
|
</mxCell>
|
||
|
|
<mxCell id="29" value="Request →" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="850" y="180" width="100" height="20" as="geometry"/>
|
||
|
|
</mxCell>
|
||
|
|
<mxCell id="30" value="Response - - →" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="850" y="200" width="100" height="20" as="geometry"/>
|
||
|
|
</mxCell>
|
||
|
|
<mxCell id="31" value="Process" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11" vertex="1" parent="1">
|
||
|
|
<mxGeometry x="850" y="230" width="100" height="30" as="geometry"/>
|
||
|
|
</mxCell>
|
||
|
|
</root>
|
||
|
|
</mxGraphModel>
|
||
|
|
</diagram>
|
||
|
|
</mxfile>
|
||
|
|
|