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

Unverified Commit 9e21a015 authored by Akhil's avatar Akhil
Browse files

Return if SSO not enabled

parent c0ef6337
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -34,6 +34,10 @@ class SSOMapper {
		$this->initConnection();
	}

	public function isSSOEnabled() : bool {
		return isset($this->conn);
	}

	public function getUserId(string $username) : string {
		$qb = $this->conn->createQueryBuilder();
		$qb->select('USER_ID')
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ class TwoFactorStateChangedListener implements IEventListener {


	public function handle(Event $event): void {
		if (!($event instanceof StateChanged) || !$this->appManager->isEnabledForUser(self::TWOFACTOR_APP_ID)) {
		if (!($event instanceof StateChanged) || !$this->appManager->isEnabledForUser(self::TWOFACTOR_APP_ID) || !$this->ssoMapper->isSSOEnabled()) {
			return;
		}