Files
freeplanet_serverside/src/server/reg/registration.js
2020-05-04 19:34:41 +02:00

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);
}
},
};