From 8481aadfd9f413620a5d16bc1e3144e1126e4839 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Mon, 8 Nov 2021 15:42:55 -0300
Subject: fix method type check

---
 packages/anastasis-webui/src/pages/home/AddingProviderScreen.tsx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'packages/anastasis-webui/src/pages/home/AddingProviderScreen.tsx')

diff --git a/packages/anastasis-webui/src/pages/home/AddingProviderScreen.tsx b/packages/anastasis-webui/src/pages/home/AddingProviderScreen.tsx
index d2d22374e..5cf6fbb09 100644
--- a/packages/anastasis-webui/src/pages/home/AddingProviderScreen.tsx
+++ b/packages/anastasis-webui/src/pages/home/AddingProviderScreen.tsx
@@ -19,12 +19,13 @@ async function testProvider(url: string, expectedMethodType?: string): Promise<v
     if (!("methods" in json) || !Array.isArray(json.methods)) {
       throw Error("This provider doesn't have authentication method. Check the provider URL")
     }
+    console.log("expected", expectedMethodType)
     if (!expectedMethodType) {
       return
     }
     let found = false
     for (let i = 0; i < json.methods.length && !found; i++) {
-      found = json.methods[i].type !== expectedMethodType
+      found = json.methods[i].type === expectedMethodType
     }
     if (!found) {
       throw Error(`This provider does not support authentication method ${expectedMethodType}`)
-- 
cgit v1.2.3

