Skip to content

Commit

Permalink
Auto-merge for PR #846 via VersionBot
Browse files Browse the repository at this point in the history
Throw a clear error when logging in with an invalid token
  • Loading branch information
resin-io-versionbot[bot] authored Apr 4, 2018
2 parents 13a35b2 + d166a65 commit 143d88f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 5 additions & 0 deletions lib/actions/auth.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 143d88f

Please sign in to comment.