Skip to content

Celer-Org/auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CelerCore Auth

Celer Core Auth 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published