         guard let url = url, isCallback(url: url) else { return false }
 
         DispatchQueue.main.asyncAfter(deadline: .now() + 3) { [weak self] in
+            self?.completed = true
             self?.success?(self?.credentialToken ?? "")
             self?.close(animated: true)
         }

        let req = URLRequest(url: url)
        webView.load(req)
    }
}

extension SAMLViewController: WKNavigationDelegate {

    var entryPointUrl: URL!
    var issuerUrl: URL!
    var provider: String = ""

    var completed: Bool = false

    var success: ((String) -> Void)?
    var failure: (() -> Void)?
