Add force regenerate token
This commit is contained in:
parent
cdfe4c4fc8
commit
775b7b287b
@ -2,6 +2,7 @@
|
||||
|
||||
- Fixed axios is not a function
|
||||
- Add generate token with data (clientId, apiKey) to server
|
||||
- Add generate token with options (-f | --force) to regenerate and override
|
||||
|
||||
### 20/10/2022
|
||||
|
||||
|
@ -227,6 +227,7 @@ program
|
||||
"setting client api key for authentication access"
|
||||
)
|
||||
.option("-p --profile <string>", "setting profile name", PROFILE_DEFAULT)
|
||||
.option("-f --force", "force to generate new client and token", false)
|
||||
.action(async (options) => {
|
||||
const configDir = path.resolve(os.homedir(), PROFILE_PATH);
|
||||
|
||||
@ -263,7 +264,7 @@ program
|
||||
config.apiKey = options.key;
|
||||
}
|
||||
|
||||
if (!config.token) {
|
||||
if (!config.token || options.force) {
|
||||
console.log("Generating token...");
|
||||
await getTokenFree(config.server, {
|
||||
timestamp: (new Date().getTime()),
|
||||
|
Loading…
Reference in New Issue
Block a user