youtube-auto-bot / scratch /reset-pass.js
Nathan
Auth: Added deep debugging for login troubleshooting
2295c9c
Raw History Blame Contribute Delete
994 Bytes
require('dotenv').config();
const { createClient } = require('@supabase/supabase-js');
const bcrypt = require('bcryptjs');
const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_KEY);
async function resetPassword() {
const email = 'yogesh234456@gmail.com';
const newPass = '123456';
const hashed = await bcrypt.hash(newPass, 10);
console.log(`🔄 Resetting password for: ${email}`);
const { data, error } = await supabase
.from('users')
.update({ password: hashed })
.ilike('email', email)
.select();
if (error) {
console.error('❌ Reset Failed:', error.message);
} else if (data.length === 0) {
console.warn('⚠️ User not found. Creating new user...');
await supabase.from('users').insert([{ email, password: hashed, role: 'user', plan: 'ultra' }]);
console.log('✅ New user created with password: 123456');
} else {
console.log('✅ Password successfully reset to: 123456');
}
}
resetPassword();