Compare commits
4 Commits
a5ade4006d
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad1e960e71 | ||
|
|
3eaded1033 | ||
|
|
6678a5b919 | ||
|
|
ce49a72e01 |
@@ -54,7 +54,8 @@ class OtpCode < ApplicationRecord
|
|||||||
sms = SmsMessage.create!(
|
sms = SmsMessage.create!(
|
||||||
direction: "outbound",
|
direction: "outbound",
|
||||||
phone_number: normalized_phone,
|
phone_number: normalized_phone,
|
||||||
message_body: "Your OTP code is: #{otp.code}. Valid for #{expiry_minutes} minutes. Do not share this code."
|
message_body: "Your OTP code is: #{otp.code}. Valid for #{expiry_minutes} minutes. Do not share this code.",
|
||||||
|
status: "queued"
|
||||||
)
|
)
|
||||||
|
|
||||||
{ otp: otp, sms: sms }
|
{ otp: otp, sms: sms }
|
||||||
|
|||||||
@@ -13,10 +13,8 @@ Rails.application.routes.draw do
|
|||||||
post "register", to: "registrations#create"
|
post "register", to: "registrations#create"
|
||||||
post "heartbeat", to: "heartbeats#create"
|
post "heartbeat", to: "heartbeats#create"
|
||||||
|
|
||||||
namespace :sms do
|
post "sms/received", to: "sms#received"
|
||||||
post "received", to: "sms#received"
|
post "sms/status", to: "sms#status"
|
||||||
post "status", to: "sms#status"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Client application endpoints
|
# Client application endpoints
|
||||||
@@ -25,10 +23,8 @@ Rails.application.routes.draw do
|
|||||||
get "sms/received", to: "sms#received"
|
get "sms/received", to: "sms#received"
|
||||||
|
|
||||||
# OTP endpoints
|
# OTP endpoints
|
||||||
namespace :otp do
|
post "otp/send", to: "otp#send_otp"
|
||||||
post "send", to: "otp#send_otp"
|
post "otp/verify", to: "otp#verify"
|
||||||
post "verify", to: "otp#verify"
|
|
||||||
end
|
|
||||||
|
|
||||||
# Admin endpoints
|
# Admin endpoints
|
||||||
namespace :admin do
|
namespace :admin do
|
||||||
|
|||||||
Reference in New Issue
Block a user