Auth.js 261 Bytes
Newer Older
이재연's avatar
이재연 committed
1
2
3
4
5
6
7
8
9
10
const users=[
    { id:'wodus', password:'123'},
    {id:'kim', password:'456'},
]

export function signIn({id,password}){
    const user=users.find(user=>user.id===id && user.password===password);
    if (user===undefined) throw new Error();
    return user;
}