logic/auth.js
// Generate and return a new jwt token.
Generate and return a new jwt token.
Generate and return a new jwt token .
async function refresh(user) {
    try {
        const jwt = await JWTHelper.generateJWT(user.username);
        return { jwt: jwt };
    } catch (error) {
        throw new NodeError('Unable to generate JWT');
    }
}
async function refresh ( user ) { try { const jwt = await JWTHelper . generateJWT ( user . username ) ; return { jwt : jwt } ; } catch ( error ) { throw new NodeError ( 'Unable to generate JWT' ) ; } }
Generate and return a new jwt token.
Generate and return a new jwt token .