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

Going through Slack OAuth flow should update the user's token and sco… #358

Merged
merged 1 commit into from
Aug 13, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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