Commit 536539ea authored by Philipp Berger's avatar Philipp Berger
Browse files

chore: release v1.1.10

parent 8a2de595
# Changelog
### 1.1.10 (2021-05-21)
* **backend** chore: improve text for fixed line voice message
### 1.1.9 (2021-05-21)
* **backend** chore: add rate limit
* **backend** chore: add additional status code to delete user route
......
{
"name": "@lucaapp/web",
"version": "1.1.9",
"version": "1.1.10",
"private": true,
"license": "Apache-2.0",
"author": "Culture4Life <hello@luca-app.de> (https://www.luca-app.de/)",
......
{
"name": "@lucaapp/backend",
"version": "1.1.9",
"version": "1.1.10",
"private": true,
"license": "Apache-2.0",
"author": "Culture4Life <hello@luca-app.de> (https://www.luca-app.de/)",
......
const config = require('config');
const axios = require('axios');
const HttpsProxyAgent = require('https-proxy-agent');
const parsePhoneNumber = require('libphonenumber-js');
const parsePhoneNumber = require('libphonenumber-js/max');
const xmlParseString = require('xml2js').parseString;
const httpsProxy = config.get('proxy.https');
......@@ -14,6 +14,13 @@ const getInternationalPhoneNumberFormat = phone => {
return phoneNumber.formatInternational().replace('+', '00').replace(/ /g, '');
};
const isFixedLinePhoneNumber = phoneNumber => {
const phone = parsePhoneNumber(phoneNumber, 'DE');
return phone.getType() === 'FIXED_LINE';
};
const addSpaces = number => number.split('').join(' ');
const createClient = baseURL => {
return axios.create({
httpsAgent: httpsProxy ? new HttpsProxyAgent(httpsProxy) : undefined,
......@@ -40,7 +47,16 @@ const sendSMSTan = async (phone, tan) => {
payload.append('version', '4.0');
payload.append('cid', config.get('sinch.cid'));
payload.append('password', config.get('sinch.password'));
payload.append('content', `Deine Luca-TAN ist: ${tan}`);
if (isFixedLinePhoneNumber(phone)) {
payload.append(
'content',
`Hallo! Das ist deine TAN für die Verifizierung im luca System: ${addSpaces(
tan
)}`
);
} else {
payload.append('content', `Deine Luca-TAN ist: ${tan}`);
}
payload.append('from', 'luca');
payload.append('to', getInternationalPhoneNumberFormat(phone));
......
{
"name": "@lucaapp/contact-form",
"version": "1.1.9",
"version": "1.1.10",
"private": true,
"license": "Apache-2.0",
"author": "Culture4Life <hello@luca-app.de> (https://www.luca-app.de/)",
......
{
"name": "@lucaapp/health-department",
"version": "1.1.9",
"version": "1.1.10",
"private": true,
"license": "Apache-2.0",
"author": "Culture4Life <hello@luca-app.de> (https://www.luca-app.de/)",
......
{
"name": "@lucaapp/locations",
"version": "1.1.9",
"version": "1.1.10",
"private": true,
"license": "Apache-2.0",
"author": "Culture4Life <hello@luca-app.de> (https://www.luca-app.de/)",
......
{
"name": "@lucaapp/scanner",
"version": "1.1.9",
"version": "1.1.10",
"private": true,
"license": "Apache-2.0",
"author": "Culture4Life <hello@luca-app.de> (https://www.luca-app.de/)",
......
{
"name": "@lucaapp/webapp",
"version": "1.1.9",
"version": "1.1.10",
"private": true,
"license": "Apache-2.0",
"author": "Culture4Life <hello@luca-app.de> (https://www.luca-app.de/)",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment