Don't bother looking up web register

Stephen Paul Weber created

Change summary

sgx_jmp.rb | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)

Detailed changes

sgx_jmp.rb 🔗

@@ -471,10 +471,18 @@ Command.new(
 			"./ns:userId", ns: "https://ns.cheogram.com/google-play"
 		)&.first&.content
 	end
-	Command.customer.catch_only(CustomerRepo::NotFound) {
-		Sentry.add_breadcrumb(Sentry::Breadcrumb.new(message: "Customer.create"))
-		Command.execution.customer_repo.create(Command.execution.iq.from.stripped)
-	}.then { |customer|
+	if Command.execution.iq.from.stripped.to_s == CONFIG[:web_register][:from]
+		Customer.new(
+			"__web_register", Command.execution.iq.from.stripped,
+			sgx: TrivialBackendSgxRepo.new.get("__web_register")
+				.with(registered?: false)
+		)
+	else
+		Command.customer.catch_only(CustomerRepo::NotFound) {
+			Sentry.add_breadcrumb(Sentry::Breadcrumb.new(message: "Customer.create"))
+			Command.execution.customer_repo.create(Command.execution.iq.from.stripped)
+		}
+	end.then { |customer|
 		Sentry.add_breadcrumb(Sentry::Breadcrumb.new(message: "Registration.for"))
 		Registration.for(customer, google_play_userid, TEL_SELECTIONS).then(&:write)
 	}.then {