 import Foundation
 import RealmSwift
 
-public class LiveChatManager: SocketManagerInjected {
+public class LiveChatManager: SocketManagerInjected, AuthManagerInjected {
 
     var injectionContainer: InjectionContainer!
     var initiated = false

            let json = response.result["result"]
            self.userId = json["userId"].stringValue
            self.token = json["token"].stringValue
            self.login {
                let roomSubscription = Subscription()
                roomSubscription.identifier = UUID().uuidString
                roomSubscription.rid = self.room
                Realm.execute({ realm in
                    realm.add(roomSubscription)
                })

        let chatViewController = storyboard.instantiateViewController(withIdentifier: "ChatViewController") as? ChatViewController
        chatViewController?.injectionContainer = injectionContainer
        guard let realm = try? Realm() else { return nil }
        guard let subscription = Subscription.find(rid: room, realm: realm) else { return nil }
        chatViewController?.subscription = subscription
        return chatViewController
    }

