GoalModelEditor/BackEnd/routes/authen.js
/** Generate the jwt token based on user id
 * @param user_id
 * @return token : jwt token encrypted with user id
 */
Generate the jwt token based on user id
@param user_id
@return token : jwt token encrypted with user id
Generate the jwt token based on user id @param user_id @return token : jwt token encrypted with user id
function genToken(user_id) {
    let token = jwt.sign({ id: user_id }, SECRET, { expiresIn: ONEDAY });
    console.log("token generated: " + token);
    return token;
}
function genToken ( user_id ) { let token = jwt . sign ( { id : user_id } , SECRET , { expiresIn : ONEDAY } ) ; console . log ( "token generated: " + token ) ; return token ; }
Generate the jwt token based on user id
 @param user_id
 @return token : jwt token encrypted with user id
Generate the jwt token based on user id @param user_id @return token : jwt token encrypted with user id