Skip to content

Instantly share code, notes, and snippets.

View zfael's full-sized avatar

Rafael Bertelli zfael

View GitHub Profile
zfael / refresh-token-approach.ts
Last active August 13, 2020 18:59
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);