Client side library for the authentication-server
const API_URL = 'http://localhost:3000';
const authenticator = new Authenticator(API_URL);
const otpSecret = await authenticator.register(email, password, captcha);
// Register otpSecret somewhere (e.g. show QR code for Google authenticator)
const API_URL = 'http://localhost:3000';
const authenticator = new Authenticator(API_URL);
// Ask client for otpToken (2FA)
const jwt = await authenticator.login(email, password, otpToken);
// Use jwt to login
yarn
yarn test