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:
@@ -18,7 +18,7 @@ const defaultUser: AppUser = {
|
|||||||
updatedAt: new Date().toISOString()
|
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';
|
const DEFAULT_ORGANIZATION_NAME = 'Organização Padrão';
|
||||||
|
|
||||||
export const AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {
|
export const AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {
|
||||||
|
|||||||
@@ -128,8 +128,12 @@ export const getProjectAnalysis = async (req: Request, res: Response) => {
|
|||||||
res.json(analysis);
|
res.json(analysis);
|
||||||
|
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
|
console.error('CRITICAL: Error in getProjectAnalysis controller:', error);
|
||||||
const message = error instanceof Error ? error.message : 'Unknown 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
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export const extractUser = async (req: Request, res: Response, next: NextFunctio
|
|||||||
email: 'guest@gpi.app',
|
email: 'guest@gpi.app',
|
||||||
name: 'Guest User',
|
name: 'Guest User',
|
||||||
role: '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'
|
organizationRole: 'user'
|
||||||
};
|
};
|
||||||
next();
|
next();
|
||||||
|
|||||||
Reference in New Issue
Block a user