Fix crash
This commit is contained in:
@@ -610,7 +610,7 @@ function userSearchSftp(req, res, next) {
|
||||
|
||||
const uidNumber = app.manifest.addons.localstorage.ftp.uid;
|
||||
|
||||
const [userGetError, user] = await users.getByUsername(username);
|
||||
const [userGetError, user] = await safe(users.getByUsername(username));
|
||||
if (userGetError) return next(new ldap.OperationsError(userGetError.toString()));
|
||||
if (!user) return next(new ldap.OperationsError('Invalid username'));
|
||||
|
||||
@@ -620,7 +620,7 @@ function userSearchSftp(req, res, next) {
|
||||
if (error) return next(new ldap.OperationsError(error.toString()));
|
||||
if (!hasAccess) return next(new ldap.InsufficientAccessRightsError('Not authorized'));
|
||||
|
||||
var obj = {
|
||||
const obj = {
|
||||
dn: ldap.parseDN(`cn=${username}@${appFqdn},ou=sftp,dc=cloudron`).toString(),
|
||||
attributes: {
|
||||
homeDirectory: app.dataDir ? `/mnt/${app.id}` : `/mnt/appsdata/${app.id}/data`,
|
||||
|
||||
Reference in New Issue
Block a user