Skip to content

Commit

Permalink
v0.0.74
Browse files Browse the repository at this point in the history
  • Loading branch information
therockerline committed May 21, 2024
1 parent 9207868 commit 5507131
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nethlink",
"version": "0.0.73",
"version": "0.0.74",
"description": "NethLink app",
"main": "./out/main/main.js",
"license": "UNLICENSED",
Expand Down
21 changes: 14 additions & 7 deletions src/main/classes/controllers/AccountController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,21 @@ export class AccountController {
} catch {
//TODO: recupera la password salvata e tenta un nuovo login
if (account.cryptPsw) {
const _accountData = JSON.parse(safeStorage.decryptString(account.cryptPsw))
const password = _accountData.password
const tempAccount: Account = {
host: _accountData.password,
username: _accountData.username,
theme: 'system'
try {
const psw: Buffer = Buffer.from((account.cryptPsw as any).data)
const decryptString = safeStorage.decryptString(psw)

const _accountData = JSON.parse(decryptString)
const password = _accountData.password
const tempAccount: Account = {
host: _accountData.host,
username: _accountData.username,
theme: 'system'
}
loggedAccount = await AccountController.instance.login(tempAccount, password)
} catch (e) {
log(e)
}
loggedAccount = await AccountController.instance.login(tempAccount, password)
} else {
//se fallisce, il token era scaduto, lo rimuovo come ultimo utente in modo che non provi ulteriomente a loggarsi con il token
this.config!.lastUser = undefined
Expand Down

0 comments on commit 5507131

Please sign in to comment.