Code Duplication    Length = 7-7 lines in 2 locations

lib/Controller/DocumentController.php 2 locations

@@ 343-349 (lines=7) @@
340
		try {
341
			$share = $this->shareManager->getShareByToken($shareToken);
342
			// not authenticated ?
343
			if($share->getPassword()){
344
				if (!$this->session->exists('public_link_authenticated')
345
					|| $this->session->get('public_link_authenticated') !== (string)$share->getId()
346
				) {
347
					throw new \Exception('Invalid password');
348
				}
349
			}
350
351
			$node = $share->getNode();
352
			if($node instanceof Folder) {
@@ 402-408 (lines=7) @@
399
		try {
400
			$share = $this->shareManager->getShareByToken($shareToken);
401
			// not authenticated ?
402
			if($share->getPassword()){
403
				if (!$this->session->exists('public_link_authenticated')
404
					|| $this->session->get('public_link_authenticated') !== (string)$share->getId()
405
				) {
406
					throw new \Exception('Invalid password');
407
				}
408
			}
409
410
			$node = $share->getNode();
411
			if ($filePath !== null) {