Giter Club home page Giter Club logo

js-session-playground's Introduction

js-session-playground

session을 이용하여 사용자 인증절차 구현

Flow

  • img;

User Table

+----------------+-------------+------+-----+---------+----------------+
| Field          | Type        | Null | Key | Default | Extra          |
+----------------+-------------+------+-----+---------+----------------+
| id             | int         | NO   | PRI | NULL    | auto_increment |
| user_name      | varchar(45) | NO   | UNI | NULL    |                |
| user_github_id | int         | NO   | UNI | NULL    |                |
+----------------+-------------+------+-----+---------+----------------+

Setup

1. Set all config file

  • 설정 파일의 경로 : server/config/*.config.js
  • (1) db.config.js
module.exports = {
	host: 'localhost',
	user: '{Your User Name}',
	password: '{Your Password}',
	database: '{Your DB}',
};
  • (2) oauth.config.js
module.exports = {
	CLIENT_ID: '{Your Github Clinet ID}',
	CLIENT_SECRET_ID: '{Your Github Secret ID}',
	CALLBACK_URL: 'http://localhost:3000/oauth/callback', // this must be same
};
  • (3) session.config.js
module.exports = {
	secret: '{Your Secret key}',
	resave: false,
	saveUninitialized: true,
};

2. Install package

npm install

3. Start 🚀

npm run start

js-session-playground's People

Contributors

mugglim avatar

Stargazers

 avatar

Watchers

 avatar  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.