Public Oauth2 app
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)