mime-chat/src/background/auth.ts
2021-02-08 09:50:35 -06:00

20 lines
506 B
TypeScript

export const authUser = (event: any, arg: any) => {
let reply;
reply = {
id: "2",
email: "hernandeze@xavier.edu",
firstName: "Enrique",
lastName: "Hernandez",
access_token: "test-token"
};
if (arg === ['undefined']) {
reply = new Error('AUTH-FAILED');
}
event.reply('auth-user-reply', reply);
}
export const authLogin = (event: any, arg: any) => {
console.log('testing login', arg);
event.reply('auth-login-reply', true);
}