feat(migration): Björn Lundén activation through Lundify's redirect flow (#2374)

* feat(migration): Björn Lundén activation through Lundify's redirect flow

BL issued our integration activation key on 2026-09-07. With
BJORN_LUNDEN_ACTIVATION_KEY set, the connect step offers "Aktivera i
Lundify": the customer logs in at Lundify, picks the company and accepts
the scopes, and Lundify returns the company's User-Key to our callback as
publicKey with our one-time state echoed as extra. The manual User-Key
field stays as a folded fallback for companies that activated inside
Lundify already.

The callback folds publicKey/extra into the OAuth-shaped locals, so the
atomic state consumption, initiator binding and white-label handoff run
unchanged; only the final step differs: submitProviderToken (the same
client-credentials probe as the manual field) instead of an OAuth code
exchange, owned by the consent's company read from the server-written row.
consumeOAuthState/consumeHandoff now return that company id.

Closes #2323.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BGDm5S2XPm6np1sKWB4U6L

* fix(migration): reset the previous connect attempt before a new provider request

Review follow-up: a failed /connect used to leave the earlier consent id
and one-time activation URL in place, so the step kept offering a link
that completed the previous consent.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BGDm5S2XPm6np1sKWB4U6L

---------

Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Jakob Wennberg
2026-09-07 15:38:07 +02:00
committed by GitHub
co-authored by Claude Fable 5.1 Jakob Wennberg
parent 8aa5d54510
commit a769bc9d03
13 changed files with 570 additions and 45 deletions
+3
View File
@@ -5729,6 +5729,9 @@
"ext_arcim_bokio_token_help": "Create or copy your integration token in Bokio under Settings → API Tokens. The company ID is the GUID in the browser address when you view the company overview. The token and company ID must come from the same Bokio company.",
"ext_arcim_bl_token_description": "First activate {appName} under Integrations in Lundify or BL Administration, then enter the company key (User-Key). {appName} connects through Björn Lundén's integration-partner access, so no API key of your own is needed.",
"ext_arcim_bl_token_help": "The company key (User-Key) is a GUID shown at the gear icon for the integration under Integrations in Lundify, or in the activation e-mail from Björn Lundén. The key only works once the integration is activated for the company.",
"ext_arcim_bl_activate_description": "Log in to Lundify, pick the company and allow {appName} to read the bookkeeping. The company key is picked up automatically when you come back.",
"ext_arcim_bl_activate_button": "Activate in Lundify",
"ext_arcim_bl_manual_key_toggle": "Already activated the integration in Lundify? Enter the company key yourself",
"ext_arcim_bokio_token_label": "Integration token",
"ext_arcim_bokio_token_placeholder": "Paste your integration token",
"ext_arcim_bokio_company_id_label": "Company ID",
+3
View File
@@ -5729,6 +5729,9 @@
"ext_arcim_bokio_token_help": "Skapa eller kopiera din integrationstoken i Bokio under Inställningar → API Tokens. Företags-ID:t är det GUID som syns i webbadressen när du visar företagets översikt. Token och företags-ID måste komma från samma Bokio-företag.",
"ext_arcim_bl_token_description": "Aktivera först {appName} under Integrationer i Lundify eller BL Administration, och ange sedan företagets nyckel (User-Key). {appName} ansluter via Björn Lundéns integrationspartner-åtkomst, så ingen egen API-nyckel behövs.",
"ext_arcim_bl_token_help": "Företagsnyckeln (User-Key) är ett GUID som visas vid kugghjulet för integrationen under Integrationer i Lundify, eller i aktiveringsmejlet från Björn Lundén. Nyckeln fungerar bara när integrationen är aktiverad för företaget.",
"ext_arcim_bl_activate_description": "Logga in i Lundify, välj företag och godkänn att {appName} får läsa bokföringen. Företagsnyckeln hämtas automatiskt när du kommer tillbaka.",
"ext_arcim_bl_activate_button": "Aktivera i Lundify",
"ext_arcim_bl_manual_key_toggle": "Har du redan aktiverat integrationen i Lundify? Ange företagsnyckeln själv",
"ext_arcim_bokio_token_label": "Integrationstoken",
"ext_arcim_bokio_token_placeholder": "Klistra in din integrationstoken",
"ext_arcim_bokio_company_id_label": "Företags-ID",