mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-25 00:11:04 +00:00
19 lines
389 B
CoffeeScript
19 lines
389 B
CoffeeScript
# TODO: Persist token in a secure manner
|
|
data = require('../data/data')
|
|
|
|
token = null
|
|
|
|
exports.saveToken = (newToken, callback) ->
|
|
token = newToken
|
|
return callback(null, token)
|
|
|
|
exports.hasToken = (callback) ->
|
|
return callback(token?)
|
|
|
|
exports.getToken = (callback) ->
|
|
return callback(null, token or undefined)
|
|
|
|
exports.clearToken = (callback) ->
|
|
token = null
|
|
return callback?(null)
|