Skip to content

Commit 5507131

Browse files
committed
v0.0.74
1 parent 9207868 commit 5507131

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nethlink",
3-
"version": "0.0.73",
3+
"version": "0.0.74",
44
"description": "NethLink app",
55
"main": "./out/main/main.js",
66
"license": "UNLICENSED",

src/main/classes/controllers/AccountController.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,21 @@ export class AccountController {
109109
} catch {
110110
//TODO: recupera la password salvata e tenta un nuovo login
111111
if (account.cryptPsw) {
112-
const _accountData = JSON.parse(safeStorage.decryptString(account.cryptPsw))
113-
const password = _accountData.password
114-
const tempAccount: Account = {
115-
host: _accountData.password,
116-
username: _accountData.username,
117-
theme: 'system'
112+
try {
113+
const psw: Buffer = Buffer.from((account.cryptPsw as any).data)
114+
const decryptString = safeStorage.decryptString(psw)
115+
116+
const _accountData = JSON.parse(decryptString)
117+
const password = _accountData.password
118+
const tempAccount: Account = {
119+
host: _accountData.host,
120+
username: _accountData.username,
121+
theme: 'system'
122+
}
123+
loggedAccount = await AccountController.instance.login(tempAccount, password)
124+
} catch (e) {
125+
log(e)
118126
}
119-
loggedAccount = await AccountController.instance.login(tempAccount, password)
120127
} else {
121128
//se fallisce, il token era scaduto, lo rimuovo come ultimo utente in modo che non provi ulteriomente a loggarsi con il token
122129
this.config!.lastUser = undefined

0 commit comments

Comments
 (0)