             }
         })
     }
-}
+
+    func isProfileEncrypted(profile: String) -> Bool {
+        let path = ProfileManager().pathForProfileWithName(profile)
+
+        let configuration = OCTManagerConfiguration.configurationWithBaseDirectory(path)!
+
+        return OCTManager.isToxSaveEncryptedAtPath(configuration.fileStorage.pathForToxSaveFile)
+    }
+}

    }

    func loginFormController(controller: LoginFormController, isProfileEncrypted profile: String) -> Bool {
        let path = ProfileManager().pathForProfileWithName(profile)

        let configuration = OCTManagerConfiguration.configurationWithBaseDirectory(path)!

        return OCTManager.isToxSaveEncryptedAtPath(configuration.fileStorage.pathForToxSaveFile)
    }
}


            errorClosure: (NSError -> Void)? = nil)
    {
        guard let password = password else {
            if isProfileEncrypted(profile) {
                // Profile is encrypted, password is required. No error is needed, password placeholder
                // should be quite obvious.
                return
            }

            let coordinator = LoginCreateAccountCoordinator(theme: theme,
                                                            navigationController: navigationController,
                                                            type: .CreatePassword)
