質問編集履歴
4
development環境でメール確認のためのgemの記載を追加しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -21,7 +21,8 @@
|
|
21
21
|
|Devise: 4.7.1|EC2、RDS(MySQL)|
|
22
22
|
|
23
23
|
**ローカル環境**
|
24
|
-
macOS: Mojave10.14.6
|
24
|
+
- macOS: Mojave10.14.6
|
25
|
+
- メール確認gem:`letter_opener_web (1.3.4)`
|
25
26
|
|
26
27
|
**認証関連gem**
|
27
28
|
- omniauth (1.9.0)
|
3
local環境のos、config/environments/production.rbのコードを追記しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -20,6 +20,9 @@
|
|
20
20
|
|Rails: 4.2.11.1|nginx: 1.16.1|
|
21
21
|
|Devise: 4.7.1|EC2、RDS(MySQL)|
|
22
22
|
|
23
|
+
**ローカル環境**
|
24
|
+
macOS: Mojave10.14.6
|
25
|
+
|
23
26
|
**認証関連gem**
|
24
27
|
- omniauth (1.9.0)
|
25
28
|
- omniauth-facebook (5.0.0)
|
@@ -34,7 +37,7 @@
|
|
34
37
|
|
35
38
|
### 該当しそうなコード
|
36
39
|
|
37
|
-
**(1/
|
40
|
+
**(1/4)db/schema.rb**
|
38
41
|
```ruby
|
39
42
|
# db/schema.rb
|
40
43
|
:
|
@@ -65,7 +68,7 @@
|
|
65
68
|
|
66
69
|
|
67
70
|
|
68
|
-
**(2/
|
71
|
+
**(2/4)app/models/user.rb**
|
69
72
|
```ruby
|
70
73
|
class User < ActiveRecord::Base
|
71
74
|
# Include default devise modules. Others available are:
|
@@ -96,7 +99,7 @@
|
|
96
99
|
end
|
97
100
|
```
|
98
101
|
|
99
|
-
**(3/
|
102
|
+
**(3/4)app/controllers/public/settings/users/omniauth_callbacks_controller.rb**
|
100
103
|
```ruby
|
101
104
|
# frozen_string_literal: true
|
102
105
|
|
@@ -129,5 +132,35 @@
|
|
129
132
|
end
|
130
133
|
end
|
131
134
|
end
|
135
|
+
```
|
136
|
+
**(4/4)config/environments/production.rb**
|
137
|
+
```ruby
|
138
|
+
Rails.application.configure do
|
139
|
+
config.cache_classes = true
|
140
|
+
config.eager_load = true
|
141
|
+
config.consider_all_requests_local = false
|
142
|
+
config.action_controller.perform_caching = true
|
143
|
+
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
144
|
+
config.assets.js_compressor = :uglifier
|
145
|
+
config.assets.compile = false
|
146
|
+
config.assets.digest = true
|
147
|
+
config.log_level = :debug
|
148
|
+
config.action_mailer.raise_delivery_errors = true
|
132
149
|
|
150
|
+
config.action_mailer.delivery_method = :smtp
|
151
|
+
config.action_mailer.smtp_settings = {
|
152
|
+
address: 'smtp.gmail.com',
|
153
|
+
port: 587,
|
154
|
+
domain: 'gmail.com',
|
155
|
+
user_name: 'toshihiro.no.ecsite@gmail.com',
|
156
|
+
password: ENV['gmail_password'],
|
157
|
+
authentication: 'plain',
|
158
|
+
enable_starttls_auto: true
|
159
|
+
}
|
160
|
+
config.i18n.fallbacks = true
|
161
|
+
config.active_support.deprecation = :notify
|
162
|
+
config.log_formatter = ::Logger::Formatter.new
|
163
|
+
config.active_record.dump_schema_after_migration = false
|
164
|
+
end
|
165
|
+
|
133
166
|
```
|
2
skip_confirmation!をコメントアウトしました
title
CHANGED
File without changes
|
body
CHANGED
@@ -119,7 +119,7 @@
|
|
119
119
|
end
|
120
120
|
|
121
121
|
@user = User.find_for_oauth(request.env['omniauth.auth'])
|
122
|
-
@user.skip_confirmation!
|
122
|
+
# @user.skip_confirmation!
|
123
123
|
if @user.persisted?
|
124
124
|
flash[:success] = I18n.t('devise.omniauth_callbacks.success', kind: provider.capitalize)
|
125
125
|
sign_in_and_redirect @user, event: :authentication
|
1
不要部分を削除しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -33,13 +33,7 @@
|
|
33
33
|
|
34
34
|
|
35
35
|
### 該当しそうなコード
|
36
|
-
【前提条件】
|
37
|
-
下記の語句は置き換えてあります
|
38
|
-
- Railsのアプリ名: 【webapp】
|
39
|
-
- 取得済みのドメイン: 【myDomain】
|
40
|
-
- 自分のグローバルIP: 【my_global_ip】
|
41
36
|
|
42
|
-
|
43
37
|
**(1/3)db/schema.rb**
|
44
38
|
```ruby
|
45
39
|
# db/schema.rb
|