]> git.sesse.net Git - skvidarsync/commitdiff
Rename $config::oauth_token to $config::slack_oauth_token, for clarity.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 29 Oct 2023 13:29:26 +0000 (14:29 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 29 Oct 2023 13:29:26 +0000 (14:29 +0100)
bin/sync.pl
include/config.pm

index 4bf7085bdec3a4a6f1ababdb06a79df3eb82397a..3dfabce8a0baea126d1b217f58335cf5f5085b25 100644 (file)
@@ -39,7 +39,7 @@ sub get_oauth_bearer_token {
 sub get_slack_name {
        my ($ua, $userid) = @_;
        my $req = HTTP::Request->new('GET', 'https://slack.com/api/users.info?user=' . $userid, [
-              'Authorization' => 'Bearer ' . $config::oauth_token
+              'Authorization' => 'Bearer ' . $config::slack_oauth_token
        ]);
        my $response = $ua->request($req);
        die $response->status_line if !$response->is_success;
@@ -279,7 +279,7 @@ sub possibly_nag_user {
                'https://slack.com/api/conversations.open',
                Content => JSON::XS::encode_json({ users => [ $userid ] }),
                Content_type => 'application/json;charset=UTF-8',
-               Authorization => 'Bearer ' . $config::oauth_token
+               Authorization => 'Bearer ' . $config::slack_oauth_token
        );
        die $response->status_line if !$response->is_success;
 
@@ -293,7 +293,7 @@ sub possibly_nag_user {
                'https://slack.com/api/chat.postMessage',
                Content => JSON::XS::encode_json({ channel => $channel_id, text => $msg }),
                Content_type => 'application/json;charset=UTF-8',
-               Authorization => 'Bearer ' . $config::oauth_token
+               Authorization => 'Bearer ' . $config::slack_oauth_token
        );
        my $msg_json = JSON::XS::decode_json($response->decoded_content);
        die "Something went wrong: " . $response->decoded_content if (!defined($msg_json) || !$msg_json->{'ok'});
index 5c7d1f4cb39f3c720fb0016500c0e769a8508682..e55cae308e517821dd43b24ce1c57b42fd9c47dc 100644 (file)
@@ -2,7 +2,7 @@ package config;
 
 our $client_secret;
 our $signing_secret;
-our $oauth_token;
+our $slack_oauth_token;
 our $jwt_key = {
         "type" => "service_account",
         "project_id" => "solskogen-cubemap",
@@ -21,7 +21,6 @@ our $gsheets_api_key;
 our $dbname = 'skvidarlang';
 our $dbuser = 'skvidarlang';
 our $dbpass;
-our $oauth_token;
 our $invitation_channel = 'C062GSYQ3C6';
 
 # Read in a local configuration file if it exists.