Giter Site home page Giter Site logo

rebar-discord-auth's Introduction

Discord Auth for Rebar Framework

this plugin allows a user to login and automatically register on your server with an discord ID.

they are required using discord

Features

  • Login and automatically register with Discord.
  • Whitelist and server check with Discord Integration

Requires

optional:

API

if you need to listen for when a player is successfully logged in you can use the discord-auth-api

import * as alt from 'alt-server';
import { useRebar } from '@Server/index.js';

const Rebar = useRebar();
const api = Rebar.useApi();

function handleLogin(player: alt.Player) {}

async function init() {
    // Get the API
    const auth = api.getAsync('discord-auth-api');
    
    // Hook in your event
    auth.onLogin(handleLogin);
}

init();

Installation

Preparation Before you can use the OAuth token you need to create a Discord application. To create a new application you need to:

  • Open the Discord Developer Portal and login with your discord account
  • Click the "New Application" button on the top right
  • Fill in your applications name and click on create
  • Go to "OAuth2" and then "General"
  • Click on "Add Redirect", enter http://127.0.0.1 and click "Save Changes" in the bottom bar
  • Copy the "CLIENT ID" on the top - it will be needed for the next step

From the main directory of your Rebar Framework.

git clone https://github.com/unfloned/rebar-discord-auth.git src/plugins/discord-auth

check server/config.ts to fill up all information needed, like CLIENT_ID from Developer Portal.

That's it.

if you wish to save the plugin in your own repository, go to src/plugins/discord-auth folder and delete the .git folder.

just change from auth-api to discord-auth-api in rebar-character-select/server/index.ts line 223 and 224.

rebar-discord-auth's People

Contributors

unfloned avatar entytaiment25 avatar csokihun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.