fix(weeztix): allow OAuth reconnect in wizard step 2 and re-sync company

Always sync company from profile after OAuth; remove skip when company_guid
was already set. Step 2 shows reconnect for connected users plus link to step 3.

Made-with: Cursor
This commit is contained in:
2026-04-05 11:16:49 +02:00
parent 89931b817d
commit 217e1d9afb
2 changed files with 21 additions and 16 deletions

View File

@@ -86,17 +86,14 @@ final class WeeztixService
}
/**
* Persist company_guid when still empty after OAuth (single company per page; chosen in Weeztix login).
* Uses the first company returned from the user profile when several are present.
* Sync company_guid/name from the Weeztix user profile for the current access token (after OAuth).
* Runs on every successful connect or reconnect so a different company chosen in Weeztix is stored here.
* Uses the first company returned from the profile when several are present.
*/
public function ensureCompanyStoredFromWeeztix(): void
{
$this->config->refresh();
if (is_string($this->config->company_guid) && $this->config->company_guid !== '') {
return;
}
try {
$companies = $this->getCompanies();
if ($companies === []) {