corebasic 1.0.170 → 1.0.172

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/libs/auth.js +2 -2
  2. package/package.json +1 -1
package/libs/auth.js CHANGED
@@ -38,7 +38,7 @@ async function attemptLogin(req, res) {
38
38
 
39
39
  let expiry = 300000
40
40
  let userMob = req.body.mob ?? req.body.phone
41
- let mob = userMob === '0123456789' ? userMob : Utils.parseMob(userMob)
41
+ let mob = userMob.endsWith('123456789') ? '0123456789' : Utils.parseMob(userMob)
42
42
  let time = new Date().getTime()
43
43
  let collection = (req.body.app ? req.body.app + '.' : '') + "auth.login"
44
44
  let errMessage = {success: false, message: "Login Server Error"}
@@ -73,7 +73,7 @@ async function attemptLogin(req, res) {
73
73
  async function sendOtp(mob, otp, app, hash) {
74
74
  try {
75
75
  if (app && hash)
76
- app = encodeURIComponent(`${app} (#${hash})`) // Of the form '<app> (#<hash>)' for better readability
76
+ app = encodeURIComponent(`${app} (#${hash})`) // Of the form '<app> (#<hash>)' for better readability. Note: Axios works with SlypBusiness%20(%23<HASH>) but Curl requires SlypBusiness%20%28%23<HASH>%29
77
77
  let api = process.env.SMS_API.replace(':phone', mob).replace(':otp', otp).replace(':app', app ?? 'app')
78
78
  await axios.get(api)
79
79
  return true
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "corebasic",
3
3
  "type": "module",
4
- "version": "1.0.170",
4
+ "version": "1.0.172",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "scripts": {