1.0.2 • Published 3 years ago

discord-webhook-oauth2 v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Public Oauth2 app

Image

Scope = Identify

Usage

const express = require('express');
const app = express();
const webhookAuth = require('discord-webhook-oauth2')
app.use(webhookAuth);

app.get('/', function(req, res){
  console.log(req.auth) //auth token
  console.log(req.user) //data about the user
})

If the user is not logged in, they will be redirected to the login screen, then back to the url.

Known issues

  • Does not work well with query parameters (will be wiped when the user is logging in)
  • Page load will sometimes be slower (because user is fetched every time)