1.1.1 • Published 2 years ago

discordmfa v1.1.1

Weekly downloads
-
License
AGPL-3.0
Repository
github
Last release
2 years ago

DiscordMFA

CodeQL

You can now provide your users with a new 2FA service. Combining your platform and a discord bot, you can now give users the ability to allow logins through discord.

Installation

Node.js 16.9.0 or newer is required.

  npm i discordmfa
  yarn add discordmfa

Optional packages

Example usage

const express = require('express'); 
const app = express();

const discordmfa = require('discordmfa');
const dmfa = new discordmfa({
    token: process.env.TOKEN,
    appId: process.env.APP_ID,
    serverId: process.env.SERVER_ID
});

app.post('/mfa/request/:id', (req, res) => {
  dmfa.send(req.params['id']); // returns void
  res.json({'success': true})
})

app.post('/mfa/response/:token', (req, res) => {
  const verify = dmfa.verify(req.params['token']); // returns a boolean
  /* Your code here */
})

dmfa.serve();
app.listen(process.env.PORT);

Links

Contributing

Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the documentation. See the contribution guide if you'd like to submit a PR.

Please adhere to this project's code_of_conduct.md.

Disclaimer we are not associated with discord

1.1.1

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago