 
     @IBOutlet weak var authButtonsStackView: UIStackView!
     var customAuthButtons = [String: UIButton]()
-    var loginService: LoginService?
-    var loginCredentialToken: String?
-    var loginCredentialSecret: String?
 
     deinit {
         NotificationCenter.default.removeObserver(self)

        }
    }

    func loginServiceSuccess(_ credential: OAuthSwiftCredential, _ response: OAuthSwiftResponse?, _ parameters: OAuthSwift.Parameters) {
        guard let loginService = self.loginService, let service = loginService.service, let scope = loginService.scope else { return }
        guard let loginToken = self.loginCredentialToken else { return }
        guard let loginSecret = self.loginCredentialSecret else { return }
        let params = [
            "oauth": [
                "credentialToken": loginToken,
                "credentialSecret": loginSecret
                ] as [String: Any]
            ]

        AuthManager.auth(params: params, completion: self.handleAuthenticationResponse)
    }

    func loginServiceFailure(_ error: OAuthSwiftError) {
        alert(title: "Error", message: ((error.errorUserInfo[NSLocalizedDescriptionKey] ?? "") as? String) ?? "")
    }
}

        let state = "{\"loginStyle\":\"popup\",\"credentialToken\":\"\(String.random(40))\",\"isCordova\":true}".base64Encoded()
        let handle = oauthSwift.authorize(withCallbackURL: callbackURL, scope: loginService.scope ?? "",
                                          state: state ?? "", success: loginServiceSuccess, failure: loginServiceFailure)
    }

    func updateLoginServices(changes: RealmCollectionChange<Results<LoginService>>) {
