Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a3d174d authored by AVINASH GUSAIN's avatar AVINASH GUSAIN
Browse files

login with device fix

parent 63e2ed0b
Loading
Loading
Loading
Loading
Loading
+23 −8
Original line number Diff line number Diff line
@@ -37,9 +37,17 @@ diff --git ./core/Controller/LoginController.php ./core/Controller/LoginControll
 		$data = new LoginData(
 			$this->request,
 			trim($user),
--- ./core/Controller/WebAuthnController.php	2022-05-11 11:11:55.469731468 +0530
+++ ./core/Controller/WebAuthnController-new.php	2022-05-30 19:34:53.540848852 +0530
@@ -73,6 +73,26 @@
--- ./core/Controller/WebAuthnController.php	2022-08-18 09:19:54.820199100 +0530
+++ ./core/Controller/WebAuthnController-new.php	2022-08-18 09:29:53.340199100 +0530
@@ -37,6 +37,7 @@
 use OCP\ISession;
 use OCP\Util;
 use Webauthn\PublicKeyCredentialRequestOptions;
+use OCP\IUserManager;

 class WebAuthnController extends Controller {
 	private const WEBAUTHN_LOGIN = 'webauthn_login';
@@ -73,6 +74,26 @@

 		$this->logger->debug('Converting login name to UID');
 		$uid = $loginName;
@@ -59,13 +67,20 @@ diff --git ./core/Controller/LoginController.php ./core/Controller/LoginControll
+			$uid = str_replace($alt_domain_suffix, '', $uid);
+		}
+
+		if(!$this->userManager->userExists($uid)) {
+		if(!\OC::$server->get(IUserManager::class)->userExists($uid)) {
+			$uid = $uid . $domain_suffix;
+		}
+
 		Util::emitHook(
 			'\OCA\Files_Sharing\API\Server2Server',
 			'preLoginNameUsedAsUserName',
@@ -115,4 +136,4 @@

 		return new JSONResponse([]);
 	}
-}
\ No newline at end of file
+}

--- ./lib/private/User/Session.php	2022-08-10 15:39:33.131890282 +0530
+++ ./lib/private/User/Session-new.php	2022-08-10 15:48:23.236165783 +0530