Skip to content

Instantly share code, notes, and snippets.

Avatar

Rafael Bertelli zfael

View GitHub Profile
@zfael
zfael / refresh-token-approach.ts
Last active Aug 13, 2020
Node.js - refresh token approach with 2 way encryption + JWT
View refresh-token-approach.ts
import crypto from 'crypto';
import jwt from 'jsonwebtoken';
import { v4 as uuid } from 'uuid';
const secret = 'your-access-token-secret';
console.log('access token secret\n', secret);
const refreshTokenSecret = 'your-refresh-token-secret';
console.log('refresh token secret\n', refreshTokenSecret);