├── .gitignore ├── LICENSE ├── package.json ├── README.md └── lock_account.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | npm-debug.log 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This Source Code Form is subject to the terms of the Mozilla Public 2 | License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fxa-lock-account", 3 | "version": "0.0.0", 4 | "description": "Lock a Firefox Account", 5 | "main": "lock_account.js", 6 | "scripts": { 7 | "start": "node lock_account.js" 8 | }, 9 | "author": "Shane Tomlinson ", 10 | "license": "MPL 2.0", 11 | "dependencies": { 12 | "commodore": "0.0.1", 13 | "fxa-js-client": "~0.1.27" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # fxa-lock-account 2 | 3 | Lock a Firefox Account from the command line. 4 | 5 | ## Installation 6 | 7 | 1. Clone the repo: `git clone https://github.com/shane-tomlinson/fxa-account-lock.git` 8 | 1. Install the dependencies: `npm install` 9 | 10 | ## Usage 11 | 12 | ```bash 13 | > node lock_account.js -e -p 14 | ``` 15 | 16 | ## Advanced usage 17 | 18 | ``` bash 19 | > node lock_account.js -a -e -p 20 | ``` 21 | 22 | ## License: 23 | This software is available under version 2.0 of the MPL: 24 | 25 | https://www.mozilla.org/MPL/ 26 | -------------------------------------------------------------------------------- /lock_account.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* This Source Code Form is subject to the terms of the Mozilla Public 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 | 7 | var program = require('commodore'); 8 | var FxaClient = require('fxa-js-client'); 9 | 10 | 11 | program 12 | .version('0.0.1') 13 | .option('-a, --auth ', 'auth server to use. Defaults to https://stomlinson.dev.lcip.org/auth/v1', 'https://stomlinson.dev.lcip.org/auth/v1') 14 | .option('-e, --email ', 'email of account to lock') 15 | .demand('e') 16 | .option('-p, --pw ', 'password of account to lock') 17 | .demand('pw') 18 | .parse(process.argv); 19 | 20 | 21 | var email = program.email; 22 | var password = program.pw; 23 | var authServer = program.auth; 24 | 25 | console.log('(%s) locking %s with %s', authServer, email, password); 26 | 27 | var fxaClient = new FxaClient(authServer); 28 | fxaClient.accountLock(email, password) 29 | .then(function () { 30 | console.log('%s locked', email); 31 | process.exit(0); 32 | }, function (err) { 33 | console.error(String(err.message)); 34 | process.exit(err.errno); 35 | }); 36 | --------------------------------------------------------------------------------