Giter Site home page Giter Site logo

ushliypakostnik / express-auth Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.17 MB

Express full auth backend module with localization on MongoDB from mLab and Express-Mailer.

JavaScript 59.27% HTML 39.60% Dockerfile 1.13%
express babel eslint mongodb mongoose mlab express-mailer password jwt jest

express-auth's Introduction

Backend Auth Module

Описание

Написанный на Express.js с Babel модуль полноценной аутентификации через JWT и Passport, использующий удаленную MongoDB с mLab и Express-Mailer.

Примеры клиентских приложений

Локализация

Сообщения об ошибках и письма направляются пользователю на языке выбранном в момент отравки запроса на клиенте.

API

POST { body : { user: { usermail, password } } }
(optional, everyone has access)
${HOST}/api/user/login

Общедоступный роут выдающий аутентификацию пользователю по адресу электронной почты и паролю и/или регистрирующий пользователя если такого емейла нет в базе.

GET
(optional, everyone has access)
${HOST}/api/user/facebook

GET
(optional, everyone has access)
${HOST}/api/user/vkontakte

Общедоступные роуты позволяющие получить аутентификацию через социальные сети Facebook и VKontakte. Если полученного от соцсети адреса электронной почты пользователя нет в базе - он добавляется в нее.

POST { user: { id } }
(authentication required)
${HOST}/api/user/send-verify-email

Защищенный роут позволяющий отправить письмо о верификации аккаунта пользователя с переданным айди

POST { body: { id } }
(optional, everyone has access)
${HOST}/api/user/verify

Общедоступнй роут позволяющий верифицировать аккаунт пользователя по полученному айди

POST { body: { usermail } }
(optional, everyone has access)
${HOST}/api/user/remind

Общедоступный роут позволяющий отправить письмо со ссылкой на востановление пароля по переданному адресу электронной почты

POST { body: { user: { id, password } } }
(authentication required)
${HOST}/api/user/password

Защищенный роут позволяющий создать новый пароль для пользователя по переданному айди

GET { user: { id } }
(authentication required)
${HOST}/api/user/profile

Защищенный роут возвращающий профиль пользователя по переданому айди

GET { user: { id } }
(authentication required)
${HOST}/api/user/logout

Защищенный роут прерывающий аутентификацию

GET
${HOST}/test

Тестовый роут

Deploy

Установка зависимостей npm packages

$ npm install

Development

$ npm start

http://localhost:8082/

Production

Запуск проекта для продакшена

$ npm run prod

Тесты

Запуск линтера

$ npm run lint

Запуск тестов

$ npm run test

express-auth's People

Contributors

ushliypakostnik avatar

Watchers

 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.