Merge pull request #30685 from nextcloud/backport/29923/stable23

[stable23] Fix users can't login external mount user entered credentials not set
This commit is contained in:
MichaIng 2022-01-17 21:20:05 +01:00 committed by GitHub
commit 58b4db7f7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,6 +76,10 @@ class SMB extends Backend {
public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
$auth = $storage->getAuthMechanism();
if ($auth->getScheme() === AuthMechanism::SCHEME_PASSWORD) {
if (!is_string($storage->getBackendOption('user')) || !is_string($storage->getBackendOption('password'))) {
throw new \InvalidArgumentException('user or password is not set');
}
$smbAuth = new BasicAuth(
$storage->getBackendOption('user'),
$storage->getBackendOption('domain'),