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

Commit 6ba0f593 authored by AVINASH GUSAIN's avatar AVINASH GUSAIN
Browse files

Merge branch 'dev/login-with-device-fix' into 'main'

login with device fix

See merge request !116
parents 63e2ed0b c69653fb
Loading
Loading
Loading
Loading
Loading
+18 −10
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 10:33:16.150199100 +0530
+++ ./core/Controller/WebAuthnController-new.php	2022-08-18 10:34:31.880199100 +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,25 @@

 		$this->logger->debug('Converting login name to UID');
 		$uid = $loginName;
@@ -59,14 +67,14 @@ 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',


--- ./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
@@ -438,7 +438,11 @@