kamiliff 0.33.0 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1af1031691e8a44c53de0db7b33a2b0b6780c745e2132045ab423cad8ba8af9
4
- data.tar.gz: a8735c527d1aa12471dd28c240e5cebb4e69cb3c15c95bd2e5c77ea5d845d26d
3
+ metadata.gz: '08439d7e6a285b6c66ce2062b66380a3a02f394d64d5f77481366aabec0a6fba'
4
+ data.tar.gz: c49f2289b9000afef8b5a3fee6c59939b213decb75b2f39ad43cc3c6c6848f80
5
5
  SHA512:
6
- metadata.gz: 0a8b0cf61a6a580a936ea67dfc384d02dbf155ebdcc647a06ee82fd1f1077bf837ca3b4af7d4024701c919f136fcf7680e3fb6f39bcf8e17656b538df8701d25
7
- data.tar.gz: a6f69448aa55004ba4561dfb6c95c54fccc27232a97a982f48c0909b932d017a672e50c9e9ef46fde9657cd2d4a23b2c0c82e26f0efe812e6ef3c09c16c05642
6
+ metadata.gz: 40006ab4d1dcccd8852c5d37e6839fae92862be4009d5ef0b78e9f977869bbfe99a82a0ba0149670afa96b6cbe4015eb36ba57094c22416361a009f5cbf0b282
7
+ data.tar.gz: b4f16684820e5ddddb9fbfb8f627ddc4701cdb38d16515cff3348936a75ab3858e5fd0e54a04a6e9b2e6191f4ea172ad7c3dc957f3f0379e3dc8128468757fc5
data/README.md CHANGED
@@ -46,22 +46,14 @@ For the [Behaviors from accessing the LIFF URL to opening the LIFF app](https://
46
46
  ### Set environment variables
47
47
  Create a file `.env` with the following content under the root directory. Kamiliff provides two setting ways, you can choose the one based on the position where LIFF apps added.
48
48
 
49
- - LIFF apps added to Messaging API channel (v1)
50
- ```
51
- LIFF_COMPACT=line://app/{FOR_COMPACT_LIFF_ID}
52
- LIFF_TALL=line://app/{FOR_TALL_LIFF_ID}
53
- LIFF_FULL=line://app/{FOR_FULL_LIFF_ID}
54
- ```
55
-
56
- - LIFF apps added to LINE Login channel (v2)
57
49
  ```
50
+ LINE_LOGIN_CHANNEL_ID={LINE_LOGIN_CHANNEL_ID}
51
+ LINE_LOGIN_CHANNEL_SECRET={LINE_LOGIN_CHANNEL_SECRET}
58
52
  LIFF_COMPACT=https://liff.line.me/{FOR_COMPACT_LIFF_ID}
59
53
  LIFF_TALL=https://liff.line.me/{FOR_TALL_LIFF_ID}
60
54
  LIFF_FULL=https://liff.line.me/{FOR_FULL_LIFF_ID}
61
55
  ```
62
56
 
63
- You could choose another setting method.
64
-
65
57
  ### Generate simple todo resource
66
58
  Create todo resource:
67
59
 
@@ -85,14 +85,35 @@ class LiffController < ActionController::Base
85
85
  # }
86
86
  def source_info
87
87
  context = params["context"]
88
- return {} if context.nil?
88
+ return {
89
+ platform_type: 'line',
90
+ liff_error: 'context not found',
91
+ } if context.nil?
89
92
 
90
93
  profile = params["profile"]
91
- return {} if profile.nil?
94
+ return {
95
+ platform_type: 'line',
96
+ liff_error: 'profile not found',
97
+ context: context,
98
+ } if profile.nil?
92
99
 
93
100
  # authorize the user id
94
101
  decoded_id_token = get_decoded_id_token
95
- return {} unless decoded_id_token["sub"] == profile["userId"] && decoded_id_token["sub"] == profile["userId"]
102
+
103
+ return {
104
+ platform_type: 'line',
105
+ liff_error: 'id token not found',
106
+ context: context,
107
+ profile: profile,
108
+ } if params["idToken"].nil?
109
+
110
+ return {
111
+ platform_type: 'line',
112
+ liff_error: 'user id does not match',
113
+ context: context,
114
+ profile: profile,
115
+ decoded_id_token: decoded_id_token
116
+ } unless decoded_id_token["sub"] == context["userId"] && decoded_id_token["sub"] == profile["userId"]
96
117
 
97
118
  source_type = context["type"].gsub("utou", "user")
98
119
  source_group_id = context["roomId"] || context["groupId"] || decoded_id_token["sub"]
@@ -17,6 +17,11 @@
17
17
  <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
18
18
  <% end %>
19
19
 
20
+ <% importmap_config_path = Dir.glob("#{Rails.root}/config/importmap.*").first %>
21
+ <% if importmap_config_path.present? %>
22
+ <%= javascript_importmap_tags %>
23
+ <% end %>
24
+
20
25
  <% has_jquery = [asset_application_js_path, webpacker_application_js_path].compact.map do |path|
21
26
  (File.read(path) =~ /jquery/i).present?
22
27
  end.any? %>
@@ -1,3 +1,3 @@
1
1
  module Kamiliff
2
- VERSION = '0.33.0'
2
+ VERSION = '0.36.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kamiliff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.33.0
4
+ version: 0.36.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - etrex kuo
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-09 00:00:00.000000000 Z
11
+ date: 2022-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -72,7 +72,7 @@ licenses:
72
72
  - MIT
73
73
  metadata:
74
74
  allowed_push_host: https://rubygems.org
75
- post_install_message:
75
+ post_install_message:
76
76
  rdoc_options: []
77
77
  require_paths:
78
78
  - lib
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  version: '0'
89
89
  requirements: []
90
90
  rubygems_version: 3.1.4
91
- signing_key:
91
+ signing_key:
92
92
  specification_version: 4
93
93
  summary: An easy way to use LINE Front-end Framework(LIFF) on rails.
94
94
  test_files: []