feat: add 2FA, secure cookies and publishing tools
This commit is contained in:
@@ -4,9 +4,9 @@ import { ArrowSquareOutIcon, CameraIcon, CircleNotchIcon, GlobeIcon, InstagramLo
|
||||
import { useAuth } from '../context/AuthContext';
|
||||
import { Profile, ProfileInput, instructorApi, profileApi } from '../services/api';
|
||||
import { CourseCoverImage } from '../components/CourseCoverImage';
|
||||
import { TwoFactorSettings } from '../components/account/TwoFactorSettings';
|
||||
import { Switch } from '../components/ui/Switch';
|
||||
import { useToast } from '../context/ToastContext';
|
||||
import { paths } from '../lib/routes';
|
||||
|
||||
const emptyProfile = (user: { id: string; email: string; name: string; role: string }): Profile => ({
|
||||
id: user.id, email: user.email, name: user.name,
|
||||
@@ -52,6 +52,7 @@ export const ProfilePage: React.FC = () => {
|
||||
<section className="form"><h2>Links e visibilidade</h2><p className="muted">Use links completos, começando com https://.</p><UrlField icon={<GlobeIcon />} label="Site" value={profile.websiteUrl} onChange={(value) => update('websiteUrl', value || null)} /><UrlField icon={<LinkedinLogoIcon />} label="LinkedIn" value={profile.linkedinUrl} onChange={(value) => update('linkedinUrl', value || null)} /><UrlField icon={<InstagramLogoIcon />} label="Instagram" value={profile.instagramUrl} onChange={(value) => update('instagramUrl', value || null)} /><UrlField icon={<YoutubeLogoIcon />} label="YouTube" value={profile.youtubeUrl} onChange={(value) => update('youtubeUrl', value || null)} /><div className="toggle"><span>Perfil público<small>Permite que outras pessoas vejam sua apresentação e seus cursos.</small></span><Switch checked={profile.isPublic} onChange={(checked) => update('isPublic', checked)} label="Perfil público" /></div></section></div>
|
||||
<button className="btn lg profile-save" type="submit" disabled={isSaving}>{isSaving ? 'Salvando…' : 'Salvar'}</button>
|
||||
</form>
|
||||
{user.role === 'superadmin' && <TwoFactorSettings />}
|
||||
</main>;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user