This website requires JavaScript.
Explore
Help
Register
Sign In
marcel
/
familienarchiv
Watch
1
Star
0
Fork
0
You've already forked familienarchiv
Code
Issues
115
Pull Requests
Actions
Packages
Projects
Releases
Wiki
Activity
Files
ab7fe81b2ade6b69b54a8ed8aad97e17c19eb428
familienarchiv
/
docs
/
architecture
/
c4
/
l3-frontend-3a-middleware-auth.puml
Marcel
c3d4762ca0
docs(c4): add L3 frontend 3a middleware/auth and 3b document workflows
2026-05-06 22:52:21 +02:00
2.4 KiB
Raw
Blame
History
Component Diagram: Web Frontend â Middleware, Auth & Layout
Component Diagram: Web Frontend â Middleware, Auth & Layout
Web Frontend (SvelteKit / SSR)
[system]
«component»
hooks.server.ts
[SvelteKit
Server
Hook]
Four
handle
layers:
(1)
handleAuth
â
redirects
unauthenticated
users
to
/login;
(2)
userGroup
â
reads
auth_token
cookie,
fetches
/api/users/me,
stores
user
in
event.locals;
(3)
handleFetch
â
injects
Authorization
header
on
all
outgoing
/api/
calls;
(4)
handleLocaleDetection
â
sets
language
cookie
from
Accept-Language
header.
«component»
hooks.ts
(Paraglide)
[SvelteKit
Client
Hook]
Client-side
i18n
middleware.
Detects
language
from
URL
and
sets
the
active
locale
for
Paraglide.js
translation
functions.
«component»
+layout.server.ts
[SvelteKit
Layout
Loader]
Passes
event.locals.user
down
to
all
child
pages
so
every
route
has
access
to
the
authenticated
user.
«component»
/login
[SvelteKit
Route]
Form
action:
encodes
email:password
as
Base64
Basic
Auth
token,
POSTs
to
/api/users/me
to
validate,
sets
auth_token
httpOnly
cookie
(SameSite=strict,
maxAge=86400),
redirects
to
/.
«component»
/logout
[SvelteKit
Route
(server-only)]
Clears
the
auth_token
cookie
and
redirects
to
/login.
«component»
/register
[SvelteKit
Route]
Loader
validates
invite
code
via
GET
/api/auth/invite/{code}.
Form
action:
POST
/api/auth/register
to
create
the
user
account.
«component»
/forgot-password
[SvelteKit
Route]
Form
action:
POST
/api/auth/forgot-password.
Always
responds
with
success
to
prevent
email
enumeration.
«component»
/reset-password
[SvelteKit
Route]
Form
action:
POST
/api/auth/reset-password
with
the
token
from
the
query
string.
«person»
User
«container»
API
Backend
[Spring
Boot]
Every
browser
request
[HTTPS]
GET
/api/users/me
(session
check)
[HTTP
/
Basic
Auth]
Redirect
if
no
token
Stores
authenticated
user
in
event.locals
POST
/api/users/me
(auth
check)
[HTTP
/
Basic
Auth]
GET
/api/auth/invite/{code},
POST
/api/auth/register
[HTTP
/
JSON]
POST
/api/auth/forgot-password
[HTTP
/
JSON]
POST
/api/auth/reset-password
[HTTP
/
JSON]
Reference in New Issue
View Git Blame
Copy Permalink