Skip to content

๐Ÿ”“ Nodejs package that interacts with the minecraft plugin "Nlogin" with the same can assemble web login system

License

Notifications You must be signed in to change notification settings

sebastianjnuwu/nlogin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

About nLogin

logo
License

"nLogin is an authentication system used by the biggest servers in Brazil now in javascript!"

plugin settings

โ€ข See below the Nlogin settings in the plugin config.yml, remember to configure MySQL.

  hashing:
    algorithm: "SHA256" # very important

settings using nodejs

โ€ข download the dependencies:

npm i nlogin-js 

main.js:

import Sequelize from 'sequelize';
import nlogin from 'nlogin-js';

const sequelize = new Sequelize('nLogin', 'root', '', {
  dialect: 'mysql',
  host: '0.0.0.0',
  port: 3006,
  logging: false,
  define: {
    timestamps: false,
  },
});

(async () => {
 await sequelize.authenticate();
})()

 // define the class with database
const plugin = new nlogin(sequelize);

 
 // perform player login 
plugin.login('name', '12356', auth => {
   console.log(auth); // return true or false
 });

 // register user 
plugin.register({ nickname: 'name', password: '123456', email: null, discord: 12345678910 }, (register) => {
  console.log(register); // return true or false
});

โ€ข run the following command:

node main.js