質問編集履歴

2

a

2023/04/10 02:40

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -10,32 +10,6 @@
10
10
 
11
11
  ### 発生している問題・エラー
12
12
  エラー文はないです。
13
- ouths_controllerの処理で、rescueに引っかかりログイン出来ないです。
14
- その時のログです。
15
- ```
16
- Started GET "/oauth/callback?provider=line&code=LzXPZHV35BKo2xZ1N0og&state=540e3240388f5e7da749c27a87e04373" for 240f:98:2ed6:1:80cf:cce2:e0e7:7b7b at 2023-04-09 17:45:16 +0900
17
- Cannot render console from 240f:98:2ed6:1:80cf:cce2:e0e7:7b7b! Allowed networks: 127.0.0.0/127.255.255.255, ::1
18
- Processing by OauthsController#callback as HTML
19
- Parameters: {"provider"=>"line", "code"=>"LzXPZHV35BKo2xZ1N0og", "state"=>"540e3240388f5e7da749c27a87e04373"}
20
- Authentication Load (0.7ms) SELECT "authentications".* FROM "authentications" WHERE "authentications"."uid" = $1 AND "authentications"."provider" = $2 ORDER BY "authentications"."id" ASC LIMIT $3 [["uid", "U391ba486e4e1bf49773ec743a2a68597"], ["provider", "line"], ["LIMIT", 1]]
21
- ↳ app/controllers/oauths_controller.rb:10:in `callback'
22
- Redirected to https://325a-240f-98-2ed6-1-80cf-cce2-e0e7-7b7b.ngrok-free.app/
23
- Completed 302 Found in 420ms (ActiveRecord: 16.2ms | Allocations: 9740)
24
-
25
-
26
- Started GET "/" for xxxxxxxxxxxxxxxxxxxxxxxxxxxxx at 2023-04-09 17:45:17 +0900
27
- Cannot render console from xxxxxxxxxxxxxxxxxxxxxxxxxxxxx! Allowed networks: 127.0.0.0/127.255.255.255, ::1
28
- Processing by TopsController#index as HTML
29
- Rendering layout layouts/application.html.erb
30
- Rendering tops/index.html.erb within layouts/application
31
- Rendered tops/index.html.erb within layouts/application (Duration: 0.2ms | Allocations: 136)
32
- Rendered layouts/_google_analytics.html.erb (Duration: 0.0ms | Allocations: 10)
33
- Rendered shared/_before_header.html.erb (Duration: 2.7ms | Allocations: 682)
34
- Rendered shared/_flash_message.html.erb (Duration: 0.1ms | Allocations: 24)
35
- Rendered shared/_footer.html.erb (Duration: 0.2ms | Allocations: 245)
36
- Rendered layout layouts/application.html.erb (Duration: 46.6ms | Allocations: 11040)
37
- Completed 200 OK in 53ms (Views: 47.9ms | ActiveRecord: 0.0ms | Allocations: 11705)
38
- ```
39
13
 
40
14
  ### 該当するソースコード
41
15
  ・xxxxxxxxxxxxxxxxx_sorcery_external.rb ↓
@@ -175,10 +149,4 @@
175
149
  ↳ (pry):13:in `callback'
176
150
  => nil
177
151
  ```
178
- @userがnilになっていることが原因だと思います。しかし、なぜ@userがnilになるかがわからないです。
179
- 考えられる原因として、
180
- ・アクセストークンが取得できていない →コールバックURLが同じでアクセスもできているはずなので、問題ない?
181
- ・チャネルIDやチャネルシークレットが正しく設定されていない → 何度も確認しましたが、スペースもないし、そもそもLINEログイン画面が出ているため、問題ない?
182
- ・ユーザー情報が取得できていない →sorcery.rbに```config.line.scope = 'profile'```と記述しているので、取得できるはず。
183
152
 
184
- ご教授いただきたいです。

1

a

2023/04/10 00:29

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -23,8 +23,8 @@
23
23
  Completed 302 Found in 420ms (ActiveRecord: 16.2ms | Allocations: 9740)
24
24
 
25
25
 
26
- Started GET "/" for 240f:98:2ed6:1:80cf:cce2:e0e7:7b7b at 2023-04-09 17:45:17 +0900
26
+ Started GET "/" for xxxxxxxxxxxxxxxxxxxxxxxxxxxxx at 2023-04-09 17:45:17 +0900
27
- Cannot render console from 240f:98:2ed6:1:80cf:cce2:e0e7:7b7b! Allowed networks: 127.0.0.0/127.255.255.255, ::1
27
+ Cannot render console from xxxxxxxxxxxxxxxxxxxxxxxxxxxxx! Allowed networks: 127.0.0.0/127.255.255.255, ::1
28
28
  Processing by TopsController#index as HTML
29
29
  Rendering layout layouts/application.html.erb
30
30
  Rendering tops/index.html.erb within layouts/application