courseplanner-backend/Services/Auth.js
//Returns a userId if the token is correct and returns null if it isn't
Returns a userId if the token is correct and returns null if it isn't
Returns a userId if the token is correct and returns null if it isn ' t
function verifyToken(token) {
    let verified;
    jwt.verify(token, process.env.JWT_SECRET, (err, authData) => {
        if (!err) verified = authData;
    });
    return verified;
}
function verifyToken ( token ) { let verified ; jwt . verify ( token , process . env . JWT_SECRET , ( err , authData ) => { if ( ! err ) verified = authData ; } ) ; return verified ; }
Returns a userId if the token is correct and returns null if it isn't
Returns a userId if the token is correct and returns null if it isn ' t