import type { OIDCUser } from '@repo/oidc-provider';

// 示例用户数据
const demoUsers: OIDCUser[] = [
    {
        sub: 'demo-user',
        username: 'demouser',
        email: 'demo@example.com',
        email_verified: true,
        name: 'Demo User',
        given_name: 'Demo',
        family_name: 'User',
        picture: 'https://via.placeholder.com/150',
        profile: 'https://example.com/demouser',
        website: 'https://example.com',
        gender: 'prefer_not_to_say',
        birthdate: '1990-01-01',
        zoneinfo: 'Asia/Shanghai',
        locale: 'zh-CN',
        phone_number: '+86-123-4567-8901',
        phone_number_verified: true,
        address: {
            formatted: '北京市朝阳区建国门外大街1号',
            street_address: '建国门外大街1号',
            locality: '朝阳区',
            region: '北京市',
            postal_code: '100020',
            country: 'CN'
        },
        updated_at: Math.floor(Date.now() / 1000)
    }
];

// 查找用户的函数
async function findUser(userId: string): Promise<OIDCUser | null> {
    return demoUsers.find(user => user.sub === userId) || null;
}

export const users = {
    findUser,
    demoUsers,
}; 