From 2c2743eb796c1c654dad8998c36cefe2751ae591 Mon Sep 17 00:00:00 2001
From: Mattsson <111893710+mattssonn@users.noreply.github.com>
Date: Sun, 5 Jul 2026 03:05:09 +0200
Subject: [PATCH] Check/salary bankid api (#892)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* fix(bankid): harden login/signup flow — polling, signup rollback, metadata merge, enrichment lookup
- middleware: read BankID enrichment from the bankid_enrichment table (the
extension_data path has been dead since the multi-tenant refactor), so
company-less BankID users land on /select-company instead of the manual wizard
- BankIdAuth: hard 6-min poll deadline; every failed poll counts toward the
give-up limit; guard overlapping ticks so completion runs exactly once
(a double /complete regenerated the magic link and invalidated the first,
failing logins intermittently); retry clicks wait out the start cooldown
instead of silently no-oping; Swedish messages for 429/unknown start errors
- bankid/complete: all-or-nothing signup — delete the created user when the
identity insert, app_metadata update, or magic-link generation fails, so a
retry starts clean instead of hitting account_exists with an unusable account
- bankid/unlink: read-merge-write app_metadata so has_password survives unlink
(BankID-only users could otherwise strand themselves with no login method)
- login: BankID "create account" CTA now links to /register instead of
dismissing the notice; sv.json: fix missing å/ä/ö in settings_bankid strings
Co-Authored-By: Claude Fable 5
- +
) : ( diff --git a/app/(dashboard)/chat/[id]/page.tsx b/app/(dashboard)/chat/[id]/page.tsx index 1fa576c6..d65b8232 100644 --- a/app/(dashboard)/chat/[id]/page.tsx +++ b/app/(dashboard)/chat/[id]/page.tsx @@ -23,21 +23,25 @@ export default async function ChatConversationPage({ params }: PageProps) { const companyId = await getActiveCompanyId(supabase, user.id) if (!companyId) redirect('/onboarding') - const { data: conversation } = await supabase - .from('agent_conversations') - .select('id, intent_id, context_ref, title, pinned, archived, last_message_at') - .eq('id', id) - .eq('company_id', companyId) - .maybeSingle() + // Both queries key on the route id, so they run in parallel. The tenant + // check on the conversation row still gates rendering — when it fails, + // notFound() throws and the messages result is discarded unrendered. + const [{ data: conversation }, { data: messages }] = await Promise.all([ + supabase + .from('agent_conversations') + .select('id, intent_id, context_ref, title, pinned, archived, last_message_at') + .eq('id', id) + .eq('company_id', companyId) + .maybeSingle(), + supabase + .from('agent_messages') + .select('role, content, hidden, created_at') + .eq('conversation_id', id) + .order('created_at', { ascending: true }), + ]) if (!conversation) notFound() - const { data: messages } = await supabase - .from('agent_messages') - .select('role, content, hidden, created_at') - .eq('conversation_id', id) - .order('created_at', { ascending: true }) - return (Verifikat
+ {lines.map((line, i) => { + const debitAmt = typeof line.debit_amount === 'number' ? line.debit_amount : 0 + const creditAmt = typeof line.credit_amount === 'number' ? line.credit_amount : 0 + return ( +Anställd hittades inte
+ return{t('detail_not_found')}
} return ( @@ -167,149 +169,160 @@ export default function EmployeeDetailPage({ params }: { params: Promise<{ id: s- {employee.personnummer} · {EMPLOYMENT_LABELS[employee.employment_type]} + {employee.personnummer} · {t(EMPLOYMENT_LABEL_KEYS[employee.employment_type])}