                     log.error err
                     if parsed.protocol is 'http:'
                         log.warn 'Did you try with an httpS URL?'
-                callback err
             else
                 deviceName = credentials.deviceName
                 password   = credentials.password
                 @saveConfig cozyUrl, syncPath, deviceName, password
-                config = file: true
-                filterSDK.setDesignDoc cozyUrl, deviceName, password, config, \
-                    callback
+            callback? err
 
 
     # Unregister current device from remote Cozy and then remove remote from

                deviceName: deviceName
                password: password
            Devices.registerDeviceSafe options, (err, credentials) ->
                callback err, credentials


    # Save the config with all the informations for synchonization

async     = require 'async'
fs        = require 'fs'
os        = require 'os'
path      = require 'path-extra'
readdirp  = require 'readdirp'
url       = require 'url'
filterSDK = require('cozy-device-sdk').filteredReplication
log       = require('printit')
    prefix: 'Cozy Desktop  '
    date: true

