From 940a41a08dbbfe0e07630d5c90a7ee4aad0338f2 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Mon, 29 Jan 2024 14:13:23 -0500 Subject: [PATCH] Don't bother looking up web register --- sgx_jmp.rb | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sgx_jmp.rb b/sgx_jmp.rb index ddcb48ade0e96fcfe0027eac5b6f3b70ccc4728c..7e978f3a36f597e319be8f46bfdf950e0bbe7639 100644 --- a/sgx_jmp.rb +++ b/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 {