Skip to content

Commit 2f5c621

Browse files
committed
fix: bad message in case of account disabled #1027
1 parent 5b3978c commit 2f5c621

28 files changed

+60
-32
lines changed

src/api.auth.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// This file is part of HFS - Copyright 2021-2023, Massimo Melina <[email protected]> - License https://www.gnu.org/licenses/gpl-3.0.txt
22

3-
import { Account, accountCanLogin, changeSrpHelper, expandUsername, getAccount, getFromAccount } from './perm'
3+
import {
4+
Account, accountCanLogin, accountIsDisabled, changeSrpHelper, expandUsername, getAccount, getFromAccount
5+
} from './perm'
46
import { ApiError, ApiHandler } from './apiMiddleware'
57
import { SRPServerSessionStep1 } from 'tssrp6a'
68
import {
@@ -47,7 +49,7 @@ export const loginSrp1: ApiHandler = async ({ username }, ctx) => {
4749
if (!account || !accountCanLogin(account)) { // TODO simulate fake account to prevent knowing valid usernames
4850
ctx.logExtra({ u: username })
4951
ctx.state.dontLog = false // log even if log_api is false
50-
return new ApiError(HTTP_UNAUTHORIZED)
52+
return new ApiError(HTTP_UNAUTHORIZED, account && accountIsDisabled(account) ? 'Account disabled' : undefined)
5153
}
5254
if (failAllowNet(ctx, account))
5355
return new ApiError(HTTP_UNAUTHORIZED)

src/langs/hfs-lang-ar.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@
189189
"Yes": "نعم",
190190
"No": "لا",
191191
"esc_again": "انقر على ESC ثانية لاغلاق",
192-
"insufficient storage": "مساحة تخزين غير كافية"
192+
"insufficient storage": "مساحة تخزين غير كافية",
193+
"Account disabled": "تم تعطيل الحساب"
193194
}
194195
}

src/langs/hfs-lang-bg.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,12 @@
182182
"creation": "създаване",
183183
"required_change_password": "Трябва да смените паролата си",
184184
"Wildcards": "Заместващи символи",
185-
"Considering resume": "Разглеждане на възобновяване",
185+
"Considering resume": "Проверка за възобновяване на качването",
186186

187187
"Yes": "Да",
188188
"No": "Не",
189189
"esc_again": "Натиснете ESC два пъти за затваряне",
190-
"insufficient storage": "недостатъчно пространство"
190+
"insufficient storage": "недостатъчно пространство",
191+
"Account disabled": "Акаунтът е деактивиран"
191192
}
192193
}

src/langs/hfs-lang-de.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@
179179
"Yes": "Ja",
180180
"No": "Nein",
181181
"esc_again": "Drucken Sie ESC zwei Mal, um das Fenster zu schließen.",
182-
"insufficient storage": "nicht genügend Speicherplatz"
182+
"insufficient storage": "nicht genügend Speicherplatz",
183+
"Account disabled": "Konto deaktiviert"
183184
}
184185
}

src/langs/hfs-lang-el.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@
190190
"Yes": "Ναι",
191191
"No": "Οχι",
192192
"esc_again": "Πατήστε ESC δυο φορές για να κλειστειτε",
193-
"insufficient storage": "ανεπαρκής χώρος αποθήκευσης"
193+
"insufficient storage": "ανεπαρκής χώρος αποθήκευσης",
194+
"Account disabled": "Ο λογαριασμός έχει απενεργοποιηθεί"
194195
}
195196
}

src/langs/hfs-lang-en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@
188188
"Yes": "Yes",
189189
"No": "No",
190190
"esc_again": "Press ESC twice to close",
191-
"insufficient storage": "insufficient storage"
191+
"insufficient storage": "insufficient storage",
192+
"Account disabled": "Account disabled"
192193
}
193194
}

src/langs/hfs-lang-es.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@
193193
"Yes": "Si",
194194
"No": "No",
195195
"esc_again": "Presione ESC dos veces para cerrar",
196-
"insufficient storage": "almacenamiento insuficiente"
196+
"insufficient storage": "almacenamiento insuficiente",
197+
"Account disabled": "Cuenta deshabilitada"
197198
}
198199
}

src/langs/hfs-lang-fi.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@
193193
"Yes": "Kyllä",
194194
"No": "Ei",
195195
"esc_again": "Paina ESC kahdesti sulkeaksesi",
196-
"insufficient storage": "riittämätön tallennustila"
196+
"insufficient storage": "riittämätön tallennustila",
197+
"Account disabled": "Tili on poistettu käytöstä"
197198
}
198199
}

src/langs/hfs-lang-fr.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@
193193
"Yes": "Oui",
194194
"No": "Non",
195195
"esc_again": "Appuyez ESC deux fois pour fermer",
196-
"insufficient storage": "espace insuffisant"
196+
"insufficient storage": "espace insuffisant",
197+
"Account disabled": "Compte désactivé"
197198
}
198199
}

src/langs/hfs-lang-hu.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@
194194
"Yes": "Igen",
195195
"No": "Nem",
196196
"esc_again": "ESC megadva 2 alkalommal",
197-
"insufficient storage": "elégtelen tárhely"
197+
"insufficient storage": "elégtelen tárhely",
198+
"Account disabled": "A fiók deaktiválva"
198199
}
199200
}

0 commit comments

Comments
 (0)