diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bf28637e..d62555d5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY! This project adheres to [Semantic Versioning](http://semver.org/). +## v7.2.2 - 2018-04-04 + +* Throw a clear error when logging in with an invalid token #846 [Tim Perry] + ## v7.2.1 - 2018-03-29 * Update docker-qemu-transpose to avoid the broken 0.4.1 release #839 [Tim Perry] diff --git a/lib/actions/auth.coffee b/lib/actions/auth.coffee index 69529b351..2df18d202 100644 --- a/lib/actions/auth.coffee +++ b/lib/actions/auth.coffee @@ -88,6 +88,11 @@ exports.login = name: 'token' type: 'input' .then(resin.auth.loginWithToken) + .tap -> + resin.auth.whoami() + .then (username) -> + if !username + patterns.expectedError('Token authentication failed') else if options.credentials return patterns.authenticate(options) else if options.web diff --git a/package.json b/package.json index 4b104aec4..8a2b315db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "resin-cli", - "version": "7.2.1", + "version": "7.2.2", "description": "The official resin.io CLI tool", "main": "./build/actions/index.js", "homepage": "https://github.com/resin-io/resin-cli",