Files
freeplanet_serverside/server/reg/registration.js
Paolo Arena c5a19f2d70 - Finished Booking an Event
- Starting UsersList (creating CGridTableRec component to view and edit a db table)
2019-10-13 20:44:05 +02:00

19 lines
425 B
JavaScript

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{
mystr = idapp + email + username;
return jwt.sign(toHexString(mystr), process.env.SIGNCODE).toString();
} catch (e) {
console.error(e);
}
},
};