Skip to content

Commit

Permalink
don’t engage in oauth if access token already configured
Browse files Browse the repository at this point in the history
  • Loading branch information
yasunariw committed Dec 23, 2020
1 parent 577eceb commit 19953a5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/action.ml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ module Action (Github_api : Api.Github) (Slack_api : Api.Slack) = struct
let process_slack_oauth (ctx : Context.t) args headers body =
try%lwt
let secrets = Context.get_secrets_exn ctx in
match secrets.slack_access_token with
| Some _ -> Lwt.return_unit
| None ->
match Slack.has_valid_signature ?signing_key:secrets.slack_signing_secret ~headers body with
| false -> action_error "failed to verify signature of slack authorization request"
| true ->
Expand Down

0 comments on commit 19953a5

Please sign in to comment.