Adding sign-up codes for member signup using Velo
Who is our client and what problem did they want to solve?
Our client focuses on teaching wellness strategies in school environments.
Their website contains private content intended only for certain users.
They contacted RHM to help provide a solution that allowed only those certain users to be authenticated upon signup with a special code.
What solution did we provide?
We accomplished this by providing a unique code to each user upon signup. This allowed them to create their account and access the content.
Our client had an existing database of access codes but needed them to be reformatted and de-duplicated.
We created a new `School Codes` content manager database, exported the old data to a CSV, and then created a `data.js` file containing a `SchoolCodes_beforeInsert` function that would run before inserting an item into the `School Codes` database.
When the function runs, it will check the database to see if the school code already exists. If it does, it rejects the insertion. If it doesn't, it transforms the code into all uppercase and proceeds to insert it into the database, thus the data was reformatted and de-duplicated.

How did we implement the solution?
To validate the school code when a new user signed up, we created a 'schoolCodeValidation.jsw' file in the backend, which allows the front end to call backend code.
With `checkSchoolCodeExistence` function, we use the wix-data module to query the `School Codes` database to verify the code exists; if so we return true, otherwise false. This code gets called on the member registration form when the school code is entered. If it is a valid school code, the user is allowed to register and create an account to access the private content.
Check out the code we used below:
import { authentication } from "wix-members";
import wixLocation from "wix-location";
import { checkSchoolCodeExistence } from "backend/schoolCodeValidation";
$w.onReady(function () {
$w("#register").onClick(async function () {
let email = $w("#email").value;
let password = $w("#password").value;
let accesscode = $w("#accesscode").value;
let name = "School";
const validSchoolCode = await checkSchoolCodeExistence(accesscode)
.then((result) => result)
.catch((err) => console.log(err));
if (validSchoolCode) {
authentication
.register(email, password, {
contactInfo: {
firstName: name,
},
})
.then(() => {
wixLocation.to("/thank-you");
});
} else {
$w("#errormsg").show();
}
});
$w("#accesscode").onChange(async (event) => {
const value = event.target.value;
const validSchoolCode = await checkSchoolCodeExistence(value)
.then((result) => result)
.catch((err) => console.log(err));
if (validSchoolCode) {
$w("#errormsg").hide();
$w("#register").enable();
} else {
$w("#errormsg").show();
$w("#register").disable();
}
});
});Our client also had a need to be able to enter new `School Codes` into the database so we created a page with a form that would check for the existence of the school code that they entered and if it didn't exist, allow them to add the school code to the database. Shoot us a message if you want to know more about this code!
Have questions about something similar? Contact us at 225-250-1888 or email robert@roberthebertmedia.com.
About our company
RHM specializes in helping businesses of all sizes and across all industries achieve their digital and web marketing needs. Whether it's designing a new website, building an app, performing custom development, or running Google Ads, our goal is to showcase how you are the best at what you do and help people connect with you. Contact us at 225-250-1888 to get started!



Часом хочеться відійти від новин і пригадати прості речі. Я помічаю, що дім затишніший, коли навіть дрібні речі мають свої місця. Окремо калькулятори онлайн зручні, якщо зрозуміла формула та перевірені вихідні дані. До речі, нумерологія цікава як традиція, хоча не здатна передбачати майбутнє. І спорт легше полюбити, якщо починати поступово й без тиску. Водночас здоров'я заслуговує уважності до звичок та перевірених медичних джерел. Так само відпочинок приносить користь, коли не стає ще одним зобов’язанням.
Brain injuries can affect memory, concentration, communication, and everyday functioning. They may follow vehicle collisions, falls, sports incidents, or workplace accidents. Some symptoms appear immediately, while others develop later, making appropriate medical assessment important after a suspected head injury. When another party’s conduct may have contributed to the incident, records of treatment, rehabilitation, and related expenses may become relevant to a howe.law claim. Personal injury cases involving brain injuries often require careful evaluation of long-term needs, documented effects, and the evidence connecting the incident to the condition.
the animatronic characters are the second thing which makes FNAF Online so appealing to people. They look quite intriguing as far as one would want to learn more about them, but their behavior is rather unpredictable and therefore, creepy. One of my favorite things about them is the need to treat each character differently and learn their pattern of behavior.
This would work well for our continuing-education portal, where we only want enrolled practitioners to create accounts. I’d love to know whether the Velo code validation can be tied to an expiration date or a one-time-use flag, so we could hand out codes per cohort without manual cleanup.
<a href="https://nano-bananapro.com/
">nano-bananapro</a>
Mình có lần lướt đọc mấy trao đổi trên mạng شيخ روحاني thì thấy nhắc nên cũng tò mò mở ra xem thử cho biết. Mình không tìm hiểu sâu جلب الحبيب chỉ xem qua trong thời gian ngắn để quan sát bố cục جلب الحبيب cách sắp xếp شيخ روحاني các mục và trình bày nội شيخ روحاني dung tổng thể. Cảm giác là các phần được trình bày khá gọn, các Huren Berlin mục rõ ràng nên đọc lướt cũng không bị rối với mình như Hurentest Berlin vậy là đủ để nắm tin cơ bản rồi. جلب الحبيب
,
,