1.1.2 • Published 2 years ago
@celercore/auth v1.1.2
CelerCore Auth
Celer Core Payments is a library with auth.
Installation
Use the package manager npm to install celercore/auth.
npm i @celercore/auth
Usage
const { Discord } = require('@celercore/auth')
const express = require('express')
const discordAuth = new Discord({
clientId: 'CLIENT_ID',
clientSecret: 'CLIENT_SECRET',
redirect: 'REDIRECT_URI',
scope: ['identify']
})
const app = express()
app.get('/login', (req, res) => {
res.redirect(discordAuth.getUrl())
})
app.get('/callback', async (req, res) => {
res.send(await discordAuth.getToken(req.query.code))
})
app.listen(3000, () => console.log('Listening...'))
Auth providers
- Discord
- Github
- Spotify
- MetaMask
- Steam
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.