Skip to content

Commit 4b3c17a

Browse files
committed
Raise error if channel_{id,secret} is not configured
1 parent 922e188 commit 4b3c17a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/line/bot/client.rb

+11
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ def credentials
6363
#
6464
# @return [Net::HTTPResponse]
6565
def issue_channel_token(grant_type = 'client_credentials')
66+
channel_id_required
67+
channel_secret_required
68+
6669
payload = URI.encode_www_form(
6770
grant_type: grant_type,
6871
client_id: channel_id,
@@ -616,6 +619,14 @@ def secure_compare(a, b)
616619
def channel_token_required
617620
raise ArgumentError, '`channel_token` is not configured' unless channel_token
618621
end
622+
623+
def channel_id_required
624+
raise ArgumentError, '`channel_id` is not configured' unless channel_id
625+
end
626+
627+
def channel_secret_required
628+
raise ArgumentError, '`channel_secret` is not configured' unless channel_secret
629+
end
619630
end
620631
end
621632
end

0 commit comments

Comments
 (0)