All Projects → BigFatDog → auth-flow-react-apollo-saga

BigFatDog / auth-flow-react-apollo-saga

Licence: other
Full stack login/register flow with React, Apollo, Redux, Redux-saga and MongoDB.

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to auth-flow-react-apollo-saga

EasyFirebase
No description or website provided.
Stars: ✭ 48 (+118.18%)
Mutual labels:  login, auth
react-login-registration
An example React / Redux / Redux Saga application talking to a Symfony 3 API
Stars: ✭ 31 (+40.91%)
Mutual labels:  redux-saga, login
gtoken
基于gf框架的token插件,通过服务端验证方式实现token认证;
Stars: ✭ 181 (+722.73%)
Mutual labels:  auth, token
ionic-login-component
Free sample of Premium Ionic Login Component
Stars: ✭ 17 (-22.73%)
Mutual labels:  login, register
yoti-java-sdk
The Java SDK for interacting with the Yoti Platform
Stars: ✭ 13 (-40.91%)
Mutual labels:  login, register
authorize-me
Authorization with social networks
Stars: ✭ 44 (+100%)
Mutual labels:  login, auth
yoti-php-sdk
The PHP SDK for interacting with the Yoti Platform
Stars: ✭ 22 (+0%)
Mutual labels:  login, register
identifo
Universal authentication framework for web, created with go
Stars: ✭ 58 (+163.64%)
Mutual labels:  login, auth
react-apple-signin-auth
 Apple signin for React using the official Apple JS SDK
Stars: ✭ 58 (+163.64%)
Mutual labels:  login, auth
supabase-ui-svelte
Supabase authentication UI for Svelte
Stars: ✭ 83 (+277.27%)
Mutual labels:  login, auth
hapi-doorkeeper
User authentication for web servers
Stars: ✭ 14 (-36.36%)
Mutual labels:  login, auth
spring-boot-mongodb-security-angular8
Spring Boot, Security, MongoDB, Angular 8: Build Authentication
Stars: ✭ 17 (-22.73%)
Mutual labels:  login, register
Apriliya-Api
Simple Web API with user authentication
Stars: ✭ 19 (-13.64%)
Mutual labels:  login, register
lua-resty-feishu-auth
适用于 OpenResty / ngx_lua 的基于飞书组织架构的登录认证
Stars: ✭ 28 (+27.27%)
Mutual labels:  login, auth
RN-login-register-screen
Usage of login / sign-in screen with register / sign-up and forget password screen for authentication in react-native with navigation and Async local storage of input values
Stars: ✭ 32 (+45.45%)
Mutual labels:  login, register
mod authnz jwt
An authentication module for Apache httpd using JSON Web Tokens
Stars: ✭ 74 (+236.36%)
Mutual labels:  auth, token
rocket auth
An implementation for an authentication API for Rocket applications.
Stars: ✭ 65 (+195.45%)
Mutual labels:  login, auth
logSys
PHP Secure, Advanced Login System
Stars: ✭ 80 (+263.64%)
Mutual labels:  login, register
UserCenter
Personal open source user center
Stars: ✭ 28 (+27.27%)
Mutual labels:  login, register
restify-jwt-community
Restify middleware that validates a JsonWebToken
Stars: ✭ 24 (+9.09%)
Mutual labels:  auth, token

Auth flow with React, Apollo, Redux-Saga and Mongo

An SSR version of this project: auth-flow-ssr

update: Added an autocomplete feature using redis, rxjs and mongodgb. If you'd like to try this feature, please install redis and then launch server. In search page, click the battery button on the bottom right of page to seed data. For more information, please visist autocomplete project page

Setup

  1. install mongodb
  2. clone this project from https://github.com/BigFatDog/auth-flow-react-apollo-saga.git
  3. npm install
  4. npm run start
  5. visit localhost:3010

Features

This application aims to demonstrate a full stack login/register flow based on React, Redux, Apollo, Redux-saga and MongoDB.

  • based on access token and refresh token. Tokens are stored in http-only cookie.
  • verify token on route change (implemented via High-Order-Component)
  • jwt middleware for both web endpoint and apollo endpoint
  • authentication status is stored as immutable object in Redux store
  • failures of verifying tokens will redirect user to login page
  • handling error messages in i18n

Common failures

  • lost server connection
  • opertation timeout
  • MongoDB down

Login failures

  • User not found
  • Invalid credentials

Register failures

  • user already exists
  • email already exists

Implementation

Project Structure

I started this project with React Boilerplate. The following adjustments are made per my own needs:

  1. server code are compiled to build/server/bundle.js
  2. .graphql support
  3. server logic are in ES6, run with node since 1.0.2
  4. server runs with esm in dev mode
  5. add apollo server and client
  6. axios is used for rest call
  7. fontawesome 5

Web Server authentication v.s. GraphQL authentication

It has been introduced in this awesome tutorial: Apollo Tutorial. I chose the web server approach.

Limitations

  • Apollo WebSocket failures haven't been verified
  • No 3rd party auth support. (passport-facebook, passport-github)
  • No Server rendering support. I'd go for next.js if server rendering is needed
  • No tests

Credits

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].