Files
freeplanet_serverside/server/reg/registration.js

19 lines
425 B
JavaScript
Raw Normal View History

2018-12-24 20:31:02 +01:00
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) {
2018-12-24 20:31:02 +01:00
try{
mystr = idapp + email + username;
2018-12-24 20:31:02 +01:00
return jwt.sign(toHexString(mystr), process.env.SIGNCODE).toString();
} catch (e) {
console.error(e);
}
},
};