Signed-off-by: Robin Appelman <robin@icewind.nl>
use OCP\Authentication\Exceptions\CredentialsUnavailableException;
use OCP\Authentication\LoginCredentials\IStore as CredentialsStore;
use OCP\Files\Storage;
+use OCP\Files\StorageAuthException;
use OCP\IL10N;
use OCP\IUser;
throw new InsufficientDataForMeaningfulAnswerException('No session credentials saved');
}
+ if ($credentials->getUID() !== $user->getUID()) {
+ throw new StorageAuthException('Session credentials for storage owner not available');
+ }
+
$storage->setBackendOption('user', $credentials->getLoginName());
$storage->setBackendOption('password', $credentials->getPassword());
}