npm.io
1.1.2 • Published 4 years ago

@celercore/auth

Licence
MIT
Version
1.1.2
Deps
1
Size
8 kB
Vulns
23
Weekly
0

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
  • Google
  • 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.

License

MIT