adding the oauth stuff to a transmitted event call in main process

This commit is contained in:
talksik
2022-03-13 13:04:39 -04:00
parent 118ffccd64
commit 6e916b2faf
+18 -1
View File
@@ -27,7 +27,7 @@ function createWindow() {
);
// Open the DevTools.
if (isDev) {
win.webContents.openDevTools({ mode: "detach" });
win.webContents.openDevTools({ mode: "attach" });
}
}
@@ -82,4 +82,21 @@ app.on("ready", () => {
// End of the file
ipcMain.on(channels.ACTIVATE_LOG_IN, (event, arg) => {
console.log("activated log in channel");
const myApiOauth = new ElectronGoogleOAuth2(
"423533244953-banligobgbof8hg89i6cr1l7u0p7c2pk.apps.googleusercontent.com",
"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",
[""],
{ successRedirectURL: "https://usenirvana.com" }
);
myApiOauth.openAuthWindowAndGetTokens().then((token) => {
// use your token.access_token
const cookie = {
name: "access_token",
value: token,
};
console.log(cookie);
});
});