summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaster4385 <venkateshchaturvedi12@gmail.com>2023-04-28 22:26:44 +0530
committerBlaster4385 <venkatesh@tablaster.dev>2024-12-17 11:47:49 +0530
commit8e9f74c0e85477a1bf40be121571a8aee6631563 (patch)
tree4bdda8fc58fd2a8062ee37b10f462ef9d8df6296
parent36b171c6ddeae8ca3d2486228b72563752c1cc32 (diff)
misc fixesHEADmain
-rw-r--r--client/src/App.js1
-rw-r--r--server/.env.sample7
-rw-r--r--server/controllers/users.js9
-rw-r--r--server/services/twilio.js1
4 files changed, 14 insertions, 4 deletions
diff --git a/client/src/App.js b/client/src/App.js
index f6ff8dd..a601134 100644
--- a/client/src/App.js
+++ b/client/src/App.js
@@ -4,6 +4,7 @@ import Index from './routes'
import './styles/GlobalVariables.css'
const App = () => {
+ localStorage.setItem('i18nextLng', 'en')
return (
<>
<LanguageSelect />
diff --git a/server/.env.sample b/server/.env.sample
new file mode 100644
index 0000000..f3ce83c
--- /dev/null
+++ b/server/.env.sample
@@ -0,0 +1,7 @@
+CONNECTION_URL =
+PORT =
+
+//TWILIO
+TWILIO_ACCOUNT_SID =
+TWILIO_AUTH_TOKEN =
+TWILIO_PHONE_NUMBER = \ No newline at end of file
diff --git a/server/controllers/users.js b/server/controllers/users.js
index 23b5013..4637f87 100644
--- a/server/controllers/users.js
+++ b/server/controllers/users.js
@@ -95,13 +95,14 @@ const updateUser = async (req, res) => {
);
if (!user.aadhaarNumber) {
+ let aadhaarnum=generateAadhaar()
await UserDetails.findByIdAndUpdate(id, {
- $set: { aadhaarNumber: generateAadhaar() },
+ $set: { aadhaarNumber: aadhaarnum },
});
-
+console.log(user)
sendSMS(
- user.mobile,
- `Dear ${user.name}, your Aadhaar Number is ${user.aadhaarNumber} for the EID ${user._id}.`
+ `+91${user.mobile}`,
+ `Dear ${user.name}, your Aadhaar Number is ${aadhaarnum} for the EID ${user._id}.`
);
}
diff --git a/server/services/twilio.js b/server/services/twilio.js
index 69eac16..ab4855f 100644
--- a/server/services/twilio.js
+++ b/server/services/twilio.js
@@ -5,6 +5,7 @@ const authToken = process.env.TWILIO_AUTH_TOKEN;
const sendSMS = (phone, message) => {
const client = twilio(accountSid, authToken);
+ console.log(phone, message);
client.messages
.create({
body: message,