// Import thư viện Firebase Admin const admin = require('firebase-admin'); // Nạp "chìa khóa" của bạn const serviceAccount = require('./serviceAccountKey.json'); // Khởi tạo ứng dụng với quyền admin admin.initializeApp({ credential: admin.credential.cert(serviceAccount) }); // ================================================================= // === THAY THÔNG TIN CỦA BẠN VÀO ĐÂY === // 1. Dán User UID của bạn vào đây const USER_UID = 'nqH1h3qy4FhtiXjiqH6Vtf8j85s1'; // 2. Đặt một mật khẩu MỚI mà bạn muốn sử dụng để đăng nhập const NEW_PASSWORD = 'lenguyenhuyedushare'; // ================================================================= // Hàm để gỡ liên kết Google và cập nhật mật khẩu async function fixUserAccount() { try { console.log(`Đang tiến hành sửa tài khoản với UID: ${USER_UID}...`); await admin.auth().updateUser(USER_UID, { password: NEW_PASSWORD, // Dòng quan trọng nhất: ra lệnh gỡ nhà cung cấp 'google.com' providerToUnlink: 'google.com' }); console.log('----------------------------------------------------'); console.log('THÀNH CÔNG!'); console.log('Đã gỡ liên kết Google và đặt mật khẩu mới thành công.'); console.log(`Bây giờ bạn có thể đăng nhập bằng mật khẩu: ${NEW_PASSWORD}`); console.log('----------------------------------------------------'); } catch (error) { console.error('----------------------------------------------------'); console.error('ĐÃ CÓ LỖI XẢY RA:', error.message); console.error('----------------------------------------------------'); } } // Chạy hàm fixUserAccount();