26 lines
473 B
JavaScript
Executable File
26 lines
473 B
JavaScript
Executable File
const jwt = require('jsonwebtoken');
|
|
|
|
function toHexString(bytes) {
|
|
return Array.from(bytes, byte =>
|
|
("00" + (byte & 0xFF).toString(16)).slice(-2)
|
|
).join('');
|
|
}
|
|
|
|
module.exports = {
|
|
getlinkregByEmail: function (idapp, email, username) {
|
|
try{
|
|
myobj = {
|
|
idapp,
|
|
email,
|
|
username
|
|
};
|
|
return jwt.sign(myobj, process.env.SIGNCODE).toString().substring(0, 180);
|
|
} catch (e) {
|
|
console.error(e.message);
|
|
}
|
|
},
|
|
|
|
|
|
|
|
};
|