mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-22 06:57:48 +00:00
24 lines
472 B
CoffeeScript
24 lines
472 B
CoffeeScript
open = require('open')
|
|
async = require('async')
|
|
resin = require('../resin')
|
|
|
|
exports.login = (credentials) ->
|
|
async.waterfall [
|
|
|
|
(callback) ->
|
|
if credentials?
|
|
return resin.auth.parseCredentials(credentials, callback)
|
|
else
|
|
return resin.ui.widgets.login(callback)
|
|
|
|
(credentials, callback) ->
|
|
resin.auth.login(credentials, callback)
|
|
|
|
], resin.errors.handle
|
|
|
|
exports.logout = ->
|
|
resin.auth.logout()
|
|
|
|
exports.signup = ->
|
|
open(resin.config.urls.signup)
|