↑↓ selectEnter openEsc close

    1. Elbuz
    2. Elbuz CMS online store
    3. Store modules
    4. Security

    How to turn on sign-in by SMS code on your website

    3 min readUpdated

    Customers sign in to an Elbuz CMS store with their phone number: the store texts a one-time code, the customer enters it and is in their account. No password to remember; password sign-in still works.

    When you need this:

    • Customers forget their password and leave — a code takes seconds, order history stays.
    • Registrations have made-up numbers — registration requires an SMS code, so numbers are real.
    • Most visitors come from a phone — on Android the code fills in automatically.

    Where to start: connect an SMS gateway, then “Store settings” → “Security” → the “Sign-in by SMS code” card.

    What sign-in by code can do

    How to turn on sign-in by code

    SMS are sent by the SMS gateway connected in the Elbuz app. Without a gateway, the “With an SMS code” option won't appear on the website.

    1. Connect a gateway in “SMS messaging” and top up your balance with the service: how to connect an SMS service.
    2. Open “Store settings” → the “Security” section → the “Sign-in by SMS code” card.
    3. On the “Main” tab, turn on “Enabled” and “Sign-in by code”.
    4. Click “Save”.

    After installation the module is off: you turn sign-in by code on yourself, a connected gateway alone is not enough. If you connected the gateway after saving the module, save the module screen once more. How “Save” works is covered in “Store settings”.

    The “Main” tab

    SwitchWhat it doesDefault
    EnabledTurns the module onoff
    Sign-in by codeThe “With password / With an SMS code” choice on the sign-in page and in the sign-in windowon
    Create an account for a new numberIf there is no customer with this phone, after the code the store creates an account and signs the customer in at once. When off, the customer is asked to registeron
    Confirm the phone with a code at registrationRegistration with a password also requires an SMS code sent to the number enteredoff

    “Create an account for a new number” is visible when “Sign-in by code” is on. The new account gets a name and a phone (the customer's number), the store's default customer group, and the newsletter turned off.

    How many codes and tries are allowed

    Every code is a paid SMS, so the store doesn't let bots waste them. The defaults suit most stores.

    Where: the “Code and limits” tab.

    FieldWhat it setsDefaultRange
    Code lengthHow many digits the code has44–6
    Code lifetime, secondsHow long the code is valid18060–900
    Next code not sooner than, secondsPause before the “Send the code again” button4020–600
    Tries to enter the codeAfter this many wrong codes, the number, the browser and the network are blocked31–10
    Codes per number within the block timeThis many SMS one number and one browser get within the block time; the next try blocks. A network gets three times more31–20
    Block time, minutesHow long the number is blocked after the limit is exceeded605–1440
    Bot protection after codes in a sessionAfter this many codes, the next one requires the “Form protection” check. 0 means from the first code10–10

    The check works only if a protection is chosen in the “Bot protection for forms” field of the store options: how to turn on form protection.

    The Elbuz app has its own limits too: up to 5 SMS per number per hour and 10 per day, 10 per hour from one address, 300 per store per day. Above the limit, the customer sees “Could not send the code…” and signs in with a password.

    Country, mask and blocked numbers

    Where: the “Phone numbers” tab.

    • Country of the numbers — “Store country” or Ukraine, Poland, Germany, France, Spain, Italy. Numbers from other countries are not accepted. The customer doesn't type the country code, only their number.
    • Number mask — how the number is shown after the country code, where “_” is a digit: “__ ___-__-__”. Empty means the country's mask. A mask with the wrong number of digits for the country doesn't apply.
    • Blocked numbers — one per line, digits only. A number that ends with a line is blocked: “000000000”. An asterisk means any digits: “38090*” blocks all +38090… numbers.

    A blocked number gets the same reply as a gateway failure: “Could not send the code…”. This way no one can find out by trial and error which numbers are on the list.

    How to change the SMS text

    If the field is empty, the store sends the default text in the website language: “Your sign-in code: …”. Your own text is set separately for each language.

    Where: the “SMS texts” tab → “SMS text for sign-in”, “SMS text for registration”. The second field is visible when “Confirm the phone with a code at registration” is on.

    • {otp} — where the code goes. Without it, the store sends the default text.
    • {store_host} — the website address.
    • Leave the last line @{store_host} #{otp} as it is: with it, the phone offers to paste the code by itself.

    The text together with the code and the address can be up to 300 characters. A longer text is replaced with the default one. The cost of one SMS depends on the service and the length: transliteration.

    What the customer sees

    On the sign-in page and in the sign-in window there is a “With password / With an SMS code” switch. A customer who is already signed in doesn't see it.

    1. The customer chooses “With an SMS code”, enters the number and clicks “Send code”.
    2. They see “Code sent to …”, enter the code and click “Sign in”. If it doesn't arrive — “Send the code again” after the pause, or “Another number”.
    3. The store opens the account, and the number becomes confirmed.

    On Android in Chrome the code is pasted automatically; on iPhone the keyboard suggests it above the digits.

    Which account opens

    What the store hasWhat happens
    An account where this number is already confirmed with a codeSign-in to that account
    One account with this numberSign-in to that account; the number becomes confirmed
    Several accounts with this number, none confirmed“This number is on several accounts: please sign in with your password”
    No accountA new account or “There is no account with this number. Please register”, depending on the “Create an account for a new number” switch

    The first sign-in by code to an account with an unconfirmed number resets its old password: why.

    Registration with a code

    When “Confirm the phone with a code at registration” is on, the registration form shows “We will send a code to this number to confirm the phone” under the phone field. Without the code the form won't create an account: “Confirm the phone with the SMS code: press «Send code»”.

    Scenarios

    Electronics: customers forget their password

    A smartphone buyer comes back for a case and a screen protector but doesn't remember the password. Turn on “Sign-in by code” and “Create an account for a new number”, and leave the SMS texts at their defaults. The customer signs in within seconds, with the order history and bonuses still there.

    Home appliances: real numbers for delivery

    The store's own service delivers washing machines, but some numbers in registrations are made up. Turn on “Confirm the phone with a code at registration” and add “000000000” and “1234567” to “Blocked numbers”. Every new account has a number the courier can actually reach.

    Any store: someone requests codes in bulk

    The SMS bill grows, but sign-ins don't. Set “Bot protection after codes in a session” to 0, “Codes per number within the block time” to 2, and “Block time, minutes” to 120.

    In the store options, choose “Elbuz form protection” in the “Bot protection for forms” field. Bots fail the check, and customers sign in as before.

    What to do when the code doesn't arrive

    What you seeWhyWhat to do
    The sign-in page has no “With an SMS code” “Enabled” or “Sign-in by code” is off, or no SMS gateway is connected Connect a gateway, turn on both switches and save the module screen
    “Could not send the code, try again later or sign in with your password” A gateway failure or empty balance, an Elbuz app limit, or the number is in “Blocked numbers” Send a test SMS, check the service balance and the list of blocked numbers
    “Check the phone number” The number is from a different country than in “Country of the numbers”, or it's incomplete Check “Country of the numbers”; customers from other countries sign in with a password
    “Too many attempts. Try again in … min or sign in with your password” The tries or the codes per number have run out The customer waits or signs in with a password; if real customers hit this often, raise the limits
    “The code has expired or was already used. Send a new one” The code's lifetime is over or the code was already entered The customer requests a new code; if SMS arrive slowly, increase “Code lifetime, seconds”

    FAQ

    After signing in with a code, the old password doesn't work. Why?

    This is by design. The first sign-in by code to an account where the number isn't yet confirmed by SMS resets the old password — to protect against someone who registered in advance with another person's number. The customer sees a message and can set a new password in their account. Later sign-ins by code don't reset the password.

    What does the SMS gateway see?

    Only the number and the SMS text. The store generates and checks the code and keeps only its irreversible hash.

    Can a customer sign in both with a password and with a code?

    Yes. An account created by code gets a random password. The customer sets their own password in their account or via “Forgot password?” if they've added an email.

    Is the phone confirmed at checkout?

    No. The code works on the sign-in page, in the sign-in window and at registration. You also can't recover a password by SMS — only by email.

    The gateway broke — can customers still buy?

    Yes. Password sign-in and checkout don't depend on the module; the customer sees “…sign in with your password”.

    Where to find it and who has access

    Menu
    Directories → Operations → Store settings → “Security” → “Sign-in by SMS code”
    Access rights
    the “Store settings” window in “Group permissions”
    Prepare
    an SMS gateway in “SMS messaging” with a topped-up balance

    Related topics

    Was this article helpful?

    Missing a feature? Tell us.

    We will add it for free if other users need it too.

    If only you need it, we will agree on it separately.

    Article contents

    Suggest an improvement

    Try Elbuz free