-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
treat the access token as a secret, do not export it
Transfer token from previous versions.
- Loading branch information
1 parent
9d45584
commit 0b21583
Showing
4 changed files
with
30 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
module.exports = function (RED) { | ||
'use strict' | ||
function ConfigVRMAPI (n) { | ||
RED.nodes.createNode(this, n) | ||
this.name = n.name | ||
this.token = n.token | ||
} | ||
RED.nodes.registerType('config-vrm-api', ConfigVRMAPI) | ||
'use strict' | ||
function ConfigVRMAPI (config) { | ||
RED.nodes.createNode(this, config); | ||
this.name = config.name; | ||
|
||
// Transfer data from previous versions | ||
if (this.credentials && !this.credentials.token && config.token) { | ||
RED.nodes.addCredentials(this.id, { token: config.token }); | ||
} | ||
|
||
// Delete deprecated properties | ||
delete config.token; | ||
delete this.token; | ||
} | ||
RED.nodes.registerType('config-vrm-api', ConfigVRMAPI, { | ||
credentials: { | ||
token: { | ||
type: 'password' | ||
}, | ||
}, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters