Sincronizando ID de organização do modo visitante com o banco de dados (e47e6210...) para carregar biblioteca e projetos corretamente; adicionando logs de depuração para análise de conformidade

This commit is contained in:
2026-04-03 16:35:20 +00:00
parent 2896c8abc2
commit 96ea8e21ef
3 changed files with 7 additions and 3 deletions

View File

@@ -18,7 +18,7 @@ const defaultUser: AppUser = {
updatedAt: new Date().toISOString()
};
const DEFAULT_ORGANIZATION_ID = '00000000-0000-0000-0000-000000000001';
const DEFAULT_ORGANIZATION_ID = 'e47e6210-4879-4e5b-bf21-9285d2713123';
const DEFAULT_ORGANIZATION_NAME = 'Organização Padrão';
export const AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {

View File

@@ -128,8 +128,12 @@ export const getProjectAnalysis = async (req: Request, res: Response) => {
res.json(analysis);
} catch (error: unknown) {
console.error('CRITICAL: Error in getProjectAnalysis controller:', error);
const message = error instanceof Error ? error.message : 'Unknown error';
res.status(500).json({ error: message });
res.status(500).json({
error: message,
stack: error instanceof Error ? error.stack : undefined
});
}
};

View File

@@ -23,7 +23,7 @@ export const extractUser = async (req: Request, res: Response, next: NextFunctio
email: 'guest@gpi.app',
name: 'Guest User',
role: 'user',
organizationId: req.headers['x-organization-id'] as string || '00000000-0000-0000-0000-000000000001',
organizationId: req.headers['x-organization-id'] as string || 'e47e6210-4879-4e5b-bf21-9285d2713123',
organizationRole: 'user'
};
next();