saveinmed/saveinmed-frontend/src/lib/auth.ts
Tiago Yamamoto b39caf0fd0 first commit
2025-12-17 13:58:26 -03:00

34 lines
No EOL
937 B
TypeScript

// ARQUIVO DESABILITADO - MIGRADO PARA BFF
// Este arquivo não é mais usado após migração para BFF
export const getCurrentUser = async () => {
console.warn('getCurrentUser() DESABILITADO - use BFF');
const storedToken = localStorage.getItem('access_token');
if (storedToken) {
return { email: 'usuario@exemplo.com' }; // Mock user
}
throw new Error('Não autenticado');
};
export const getUserWithRetry = async () => {
console.warn('getUserWithRetry() DESABILITADO - use BFF');
return getCurrentUser();
};
export const getCurrentUserWithRetry = async () => {
console.warn('getCurrentUserWithRetry() DESABILITADO - use BFF');
return getCurrentUser();
};
export const requireAuth = async () => {
console.warn('requireAuth() DESABILITADO - use BFF');
const storedToken = localStorage.getItem('access_token');
if (!storedToken) {
throw new Error('Não autenticado');
}
return true;
};