Commit Graph

9 Commits

Author SHA1 Message Date
Henrik Jess Nielsen
7dd58256aa fix: move api_log to server-side store — prevents session cookie overflow on step 4+
All checks were successful
Build and Deploy / deploy (push) Successful in 55s
2026-05-23 01:25:02 +02:00
Henrik Jess Nielsen
1471d0f67f fix: asyncio lock on callback to prevent concurrent duplicate code exchange
All checks were successful
Build and Deploy / deploy (push) Successful in 1m2s
2026-05-23 01:10:38 +02:00
Henrik Jess Nielsen
c3bc6a48a0 fix: guard against duplicate callback — skip token exchange if already stored
All checks were successful
Build and Deploy / deploy (push) Successful in 37s
2026-05-23 01:06:45 +02:00
Henrik Jess Nielsen
b14b88dadd fix: server-side token store — løser cookie overflow bug (>4KB)
All checks were successful
Build and Deploy / deploy (push) Successful in 27s
JWTs (app_token + user_token) gemmes nu i _token_store dict server-side.
Cookien holder kun sid UUID (~36 chars) — aldrig under 4KB grænsen.

- Tilføjet _token_store, _get_sid, _store_token, _load_token helpers
- Step 1-5 + /callback migreret til _store_token/_load_token
- Reset rydder nu token store for den aktuelle session
- Verified: fuldt flow gennemkørt lokalt, Step 4 virker
2026-05-22 23:38:37 +02:00
Henrik Jess Nielsen
179424a78f fix: link Tink Link to the user created in Step 2
All checks were successful
Build and Deploy / deploy (push) Successful in 22s
Previously Step 2 (create user) and Step 3 (Tink Link) were disconnected —
the bank connection went to an anonymous new user, not the one just created.

Fix: Step 3 now calls /api/v1/oauth/authorization-grant/delegate with the
user_id from session to get an authorization_code, which is injected into
the Tink Link URL. This binds the bank connection to the correct customer.

Also stores user_market in session so Step 3 uses the same market as Step 2.
Shows a note confirming which user Tink Link is bound to.
2026-05-22 21:45:58 +02:00
Henrik Jess Nielsen
5e14a219b1 feat: add Tink API request logger
All checks were successful
Build and Deploy / deploy (push) Successful in 21s
- TinkClient now accepts on_request callback; all API methods log via
  shared _get/_post helpers (method, url, req/resp body, status, timing)
- _logger(sess) helper creates a session-bound callback (max 50 entries)
- All route handlers pass _logger(sess) to _client()
- New GET /demo/log — shows all API calls in reverse-chronological order,
  collapsible req/resp bodies, status + duration badges
- New POST /demo/log/clear — clears the log
- Navbar gets 'API Log' link (always visible)
- _ctx() now applied to ALL template responses (steps 1–6)
2026-05-22 19:20:33 +02:00
Henrik Jess Nielsen
a77c709d4d Test test test
All checks were successful
Build and Deploy / deploy (push) Successful in 22s
2026-05-22 19:18:38 +02:00
Henrik Jess Nielsen
3f687bb212 fix: step 6 webhooks demo - replace 404 events API with webhook registration flow
Some checks failed
Build and Deploy / deploy (push) Failing after 10m23s
- Replace /events/v2/* endpoints (404 in sandbox) with /api/v1/webhooks
- Add list_webhooks() and register_webhook() methods to TinkClient
- Step 6 now shows: webhook flow diagram + curl examples + live API + sample payload
- Handle sandbox 404 gracefully (shows example data, no red error)
- Remove .env.production from git tracking (credentials via Gitea secrets)
- deploy.yml: write .env.production from TINK_CLIENT_ID/SECRET secrets
2026-05-22 19:04:06 +02:00
Henrik Jess Nielsen
26a16e3638 First attempt to tink demo
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
2026-05-22 18:30:59 +02:00