Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #358 from sundeepgupta/updateSlackCredsOnAuth
Browse files Browse the repository at this point in the history
Going through Slack OAuth flow should update the user's token and sco…
  • Loading branch information
Ben Brown authored Aug 13, 2016
2 parents f250c82 + adeeb7e commit 59558e9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/SlackBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,12 +484,16 @@ function Slackbot(configuration) {
isnew = true;
user = {
id: identity.user_id,
access_token: auth.access_token,
scopes: scopes,
team_id: identity.team_id,
user: identity.user,
};
}

// Always update these because the token could become invalid
// and scopes could change.
user.access_token = auth.access_token;
user.scopes = scopes;

slack_botkit.storage.users.save(user, function(err, id) {

if (err) {
Expand Down

0 comments on commit 59558e9

Please sign in to comment.