npm install --save oaun
Import components like:
import { DiscordAuth } from 'oaun'import { DiscordAuth } from 'oaun';
const CLIENT_ID = 'The client id of your app';
const CLIENT_SECRET = 'The client secret of your app';
const CLIENT_SCOPES = ['identify'] // A Array of scope that you need
const CLIENT_REDIRECT = 'http://localhost:3000/login/callback'; // The redirect URL of your app
// Setup the button
const auth = new DiscordAuth({
client_id: CLIENT_ID,
client_secret: CLIENT_SECRET,
scopes: CLIENT_SCOPES,
redirect_uri: CLIENT_REDIRECT
})
auth.login() // Open popup to login
.then(user => {
console.log(user);
})
.catch(error => {
console.log(error);
})Here is a plan of what Oaun should contain:
- GoogleAuth
- FacebookAuth
- TwitterAuth
- DiscordAuth
- GithubAuth
- GitlabAuth
- BitbucketAuth
- ShareAuth
- A 0 dependencies package
- A easy and fast component to use (plug & play component)
- A server-side librairy
- Clone this repo: git clone https://github.com/Olyno/oaun.git
- Install dependencies:
npm ioryarn - Add your components in the
componentsdir - Make a pull request
Code released under GNU license.
Copyright ©, Olyno.