dscf-core 0.3.11 → 0.3.12
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 +4 -4
- data/app/controllers/dscf/core/auth_controller.rb +14 -1
- data/lib/dscf/core/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3d5c9ec3fc1c7652890999a1d4a0a51c803c5a76048a2ae19e618eed764bfeaa
|
|
4
|
+
data.tar.gz: 774c4fe39b0d823b1c76445ef8a6ad3908cc4a7c2042265fe97c3e23641a957d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 95e7d2bf92eb2630122b13d92983636e0b616fcd09752f513ea00a4ed828f40defb83246d6ddbfb34613241009ba43f113ddff366fdda258f85a7b034527cfb9
|
|
7
|
+
data.tar.gz: 1a9ca7f46e79f9a04434ccafe465a947d0c26334ed00bbd02733dda7e8d62287c561236aeef8479cf7283d1ac5bfc264d568bc329109c98dbb72e3118016aa1e
|
|
@@ -154,12 +154,25 @@ module Dscf
|
|
|
154
154
|
def create_retailer_from_signup!(user)
|
|
155
155
|
return unless defined?(Dscf::Marketplace::Retailer)
|
|
156
156
|
|
|
157
|
+
# `authenticate_user` is skipped for this action so self-service
|
|
158
|
+
# signup stays public, but `current_user` still resolves whatever
|
|
159
|
+
# Bearer token was sent — an agent onboarding a retailer on their
|
|
160
|
+
# behalf attaches their own token, so we derive the onboarding
|
|
161
|
+
# agent from it rather than trusting a client-supplied agent_id
|
|
162
|
+
# (there is none in this params shape today, but this keeps the
|
|
163
|
+
# same trust model as the rest of the agent-assisted flows).
|
|
164
|
+
onboarding_agent = if defined?(Dscf::Marketplace::Agent)
|
|
165
|
+
Dscf::Marketplace::Agent.find_by(user_id: current_user&.id)
|
|
166
|
+
end
|
|
167
|
+
|
|
157
168
|
retailer = Dscf::Marketplace::Retailer.create!(
|
|
158
169
|
name: retailer_signup_params[:name],
|
|
159
170
|
phone: retailer_signup_params[:phone],
|
|
160
171
|
tin_number: retailer_signup_params[:tin_number],
|
|
161
172
|
location: retailer_signup_params[:location],
|
|
162
|
-
user: user
|
|
173
|
+
user: user,
|
|
174
|
+
agent: onboarding_agent,
|
|
175
|
+
onboarded_at: (Time.current if onboarding_agent)
|
|
163
176
|
)
|
|
164
177
|
|
|
165
178
|
if retailer.location.present? && defined?(Dscf::Core::Address)
|
data/lib/dscf/core/version.rb
CHANGED