authmagic-smsc-plugin
Version:
<img src="https://github.com/authmagic/authmagic/blob/master/docs/images/logo.png?raw=true" width="300px"/>
10 lines (8 loc) • 367 B
JavaScript
module.exports = function({url, securityKey}) {
const splitBy = (inp, step = 2, separator = "-") =>
inp.toString().split("").reduce((acc, val, index) => acc + (index%step || index===0 ? val : separator+val), "");
if(url) {
return `To authorize enter ${splitBy(securityKey)} or click ${url}`;
}
return `To authorize enter ${splitBy(securityKey)}`;
};