diff --git a/doc/cli.markdown b/doc/cli.markdown index 3343e4ca..2b8c3544 100644 --- a/doc/cli.markdown +++ b/doc/cli.markdown @@ -388,13 +388,10 @@ Examples: Use this command to register a device to an application. -Note that device api keys are only supported on ResinOS 2.0.3+ - Examples: $ resin device register MyApp $ resin device register MyApp --uuid - $ resin device register MyApp --uuid --device-api-key ### Options @@ -402,10 +399,6 @@ Examples: custom uuid -#### --deviceApiKey, -k <device-api-key> - -custom device key - note that this is only supported on ResinOS 2.0.3+ - ## device rm <uuid> Use this command to remove a device from resin.io. diff --git a/lib/actions/device.coffee b/lib/actions/device.coffee index 20d86288..10a3db0e 100644 --- a/lib/actions/device.coffee +++ b/lib/actions/device.coffee @@ -142,13 +142,10 @@ exports.register = help: ''' Use this command to register a device to an application. - Note that device api keys are only supported on ResinOS 2.0.3+ - Examples: $ resin device register MyApp $ resin device register MyApp --uuid - $ resin device register MyApp --uuid --device-api-key ''' permission: 'user' options: [ @@ -158,7 +155,6 @@ exports.register = parameter: 'uuid' alias: 'u' } - commandOptions.optionalDeviceApiKey ] action: (params, options, done) -> Promise = require('bluebird') @@ -167,14 +163,8 @@ exports.register = Promise.join( resin.models.application.get(params.application) options.uuid ? resin.models.device.generateUniqueKey() - options.deviceApiKey ? resin.models.device.generateUniqueKey() - (application, uuid, deviceApiKey) -> - console.info("Registering to #{application.app_name}: #{uuid}") - if not options.deviceApiKey? - console.info("Using generated device api key: #{deviceApiKey}") - else - console.info('Using provided device api key') - return resin.models.device.register(application.id, uuid, deviceApiKey) + (application, uuid) -> + return resin.models.device.register(application.id, uuid) ) .get('uuid') .nodeify(done)