Skip to content

Commit

Permalink
Display channel select message on succeeded
Browse files Browse the repository at this point in the history
  • Loading branch information
ngs committed Mar 27, 2018
1 parent 0774f57 commit fef6790
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/routes.go
Expand Up @@ -85,6 +85,12 @@ func (app *App) handleSlackOAuthCallback(w http.ResponseWriter, r *http.Request)
ctx.UserID = state.UserID
ctx.setSlackAccessToken(token)
ctx.deleteState(stateKey)
go func() {
params, _ := ctx.getChannelSelectSlackMessage()
params.Text = "認証が完了しました :white_check_mark:"
b, _ := json.Marshal(params)
http.Post(state.ResponseURL, "application/json", bytes.NewBuffer(b))
}()
http.Redirect(w, r, "/success", http.StatusFound)
}

Expand Down
1 change: 1 addition & 0 deletions app/state_test.go
Expand Up @@ -22,6 +22,7 @@ func TestState(t *testing.T) {
{"random-24-2", state},
{"FOO", ctx.getState(state).UserID},
{"T123456", ctx.getState(state).TeamID},
{"http://foo.com/bar", ctx.getState(state).ResponseURL},
} {
test.Compare(t)
}
Expand Down

0 comments on commit fef6790

Please sign in to comment.