mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-02-20 09:26:42 +00:00
Throw a clear error when logging in with an invalid token
Change-Type: patch
This commit is contained in:
parent
13a35b288f
commit
dd268993b3
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user