This commit is contained in:
seb
2026-10-28 00:08:02 +01:00
parent 1ac6435c3f
commit 1c5385061c
11 changed files with 105 additions and 37 deletions

View File

@@ -1,5 +1,6 @@
import * as db from '../../../db/googleAuth.js';
import { clearCachedUser } from '../../middleware/auth.js';
import { setUserCompany } from '../../sse.js';
/**
* Registers the selected-company route (requires auth middleware).
@@ -17,6 +18,7 @@ export function register(app, basePath = '') {
* security:
* - cookieAuth: []
* x-markdown: auth/selected-company.md
* x-signals: [company]
* requestBody:
* required: true
* content:
@@ -76,6 +78,7 @@ export function register(app, basePath = '') {
selectedCompanyId: updated.selectedCompanyId,
};
setUserCompany(req.user.id, updated.selectedCompanyId);
res.status(200).json({ user });
} catch (error) {
console.error('Set selected company failed:', error);