add background auth and login
This commit is contained in:
parent
29f6b759f8
commit
c9f8ea6337
3 changed files with 46 additions and 67 deletions
20
src/background/auth.ts
Normal file
20
src/background/auth.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
export const authUser = (event: any, arg: any) => {
|
||||
let reply;
|
||||
reply = {
|
||||
id: "2",
|
||||
email: "[email protected]",
|
||||
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);
|
||||
}
|
||||
Loading…
Reference in a new issue