-
Notifications
You must be signed in to change notification settings - Fork 700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src/client: fix storing updated token, ensure client config is always an object #437
Conversation
e938189
to
fbd9db4
Compare
@xPaw, do you mind taking a quick look at this one? |
if (config) { | ||
if (!config.token) { | ||
client.updateToken(function() { | ||
client.manager.updateUser(client.name, {token: config.token}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem was specifically this line, which should have been client.config.token
.
👍 Good catch. Feel free to fix my comments, if you want to. |
fd3cb25
to
cdb3618
Compare
d5c9f1b
to
a658dc2
Compare
@@ -55,6 +55,9 @@ var inputs = [ | |||
}, {}); | |||
|
|||
function Client(manager, name, config) { | |||
if (config === undefined || typeof config !== "object") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined isn't an object, so the first check isn't necessary.
a658dc2
to
6551dd9
Compare
delay += 1000; | ||
}); | ||
|
||
log.info("User '" + name + "' loaded"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a check for name
, otherwise it's going to print undefined
for users in public mode.
bdec503
to
4971d18
Compare
4971d18
to
fe96857
Compare
Ok patch should be final now. |
fe96857
to
5126261
Compare
Still 👍 |
5126261
to
03398d5
Compare
This also fixes an issue where the token would not be stored in the user file.
03398d5
to
32b46bb
Compare
👍 and merging, thanks! |
src/client: fix storing updated token, ensure client config is always an object
This also fixes an issue where the token would not be stored in the
user file.
Just want to point out that
config !== client.config
as well (hence breakage in the first place).