···11-import { randomUUID } from 'crypto';
21import { eq } from 'drizzle-orm';
32import { users, sessions } from './schema/users';
33+44+// Generate UUID using the Web Crypto API instead of Node's crypto
55+function randomUUID() {
66+ // Use standard Web Crypto API to generate UUID
77+ if (typeof crypto !== 'undefined' && crypto.randomUUID) {
88+ return crypto.randomUUID();
99+ }
1010+1111+ // Fallback implementation if crypto.randomUUID is not available
1212+ const getRandomHex = (c) => {
1313+ const r = crypto.getRandomValues(new Uint8Array(1))[0];
1414+ return (c === 'x' ? r & 0x3 | 0x8 : r & 0xf).toString(16);
1515+ };
1616+1717+ return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, getRandomHex);
1818+}
419520// For password hashing in a web environment, we'll use the Web Crypto API
621async function hashPassword(password) {