feat: add 2FA, secure cookies and publishing tools
All checks were successful
CI / Validate frontend and API (push) Successful in 3m5s
CI / Build and publish Docker images (push) Successful in 1m42s

This commit is contained in:
Cauê Faleiros
2026-11-06 10:29:37 -03:00
parent fff63f5efa
commit 50905eefd7
40 changed files with 3493 additions and 215 deletions

View File

@@ -2,11 +2,15 @@ import React, { useEffect } from 'react';
import { useLocation } from 'react-router-dom';
import { Sidebar } from './Sidebar';
import { MobileBack, MobileTabBar } from './MobileNavigation';
import { useAuth } from '../../context/AuthContext';
import { useIsMobile } from '../../hooks/useMediaQuery';
import { paths } from '../../lib/routes';
export const AppShell: React.FC<{ children: React.ReactNode }> = ({ children }) => {
const location = useLocation();
const isMobile = useIsMobile();
const { user, stopImpersonation } = useAuth();
const impersonating = Boolean(user?.impersonatedBy);
useEffect(() => {
window.scrollTo(0, 0);
@@ -16,6 +20,10 @@ export const AppShell: React.FC<{ children: React.ReactNode }> = ({ children })
return (
<>
{impersonating && <div className="impersonation-banner" role="status">
<span>Você está vendo a plataforma como <b>{user?.name}</b>.</span>
<button type="button" onClick={async () => { if (await stopImpersonation()) window.location.assign(paths.admin); }}>Sair da impersonação</button>
</div>}
{!isMobile && <Sidebar />}
{isMobile && <MobileBack />}
{/* Keyed by path: the arrival animation only plays when navigating to a new page. */}