added basic auth service

This commit is contained in:
SrGooglo 2024-03-25 14:06:17 +01:00
parent 3ae13ccc61
commit a84fab1882
2 changed files with 10 additions and 0 deletions

5
src/main/auth.js Normal file
View File

@ -0,0 +1,5 @@
class AuthService {
authorizeFromUrl(url) {
console.log("authorizeFromUrl", url)
}
}

View File

@ -32,6 +32,8 @@ class ElectronApp {
this.win = null
}
authService = new AuthService()
handlers = {
"pkg:list": async () => {
return await this.pkgManager.getInstalledPackages()
@ -168,6 +170,9 @@ class ElectronApp {
case "install": {
return sendToRender("installation:invoked", value)
}
case "authorize": {
return authService.authorizeFromUrl(url)
}
default: {
return sendToRender("new:message", {
message: "Unrecognized URL action"