Git Product home page Git Product logo

react.auth.server.exercise's Introduction

Authentication - Server

Cookies vs Tokens

Cookie

The purpose of cookies is to bring state into stateless protocol which is HTTP.

In HTTP solely by including these cookies on request can identify us to the server.

Cookies are included on all HTTP request by default in header.

Also server can place information into the cookies so later on server can identify that client.

  • Automatically included on all requests
  • Unique to each domain ( cannot be shared)
  • Cannot be sent to different domains

Token

  • Have to manually wire up
  • Can be sent to any domain

Authentication - Client

Redux Thunk

  • dispatch : Makes sure the action gets sent to all reducers after sent through all different middlewares.

The main purpose of Redux Thunk is that we can directly access dispatch method.

Redux Thunk returns function instead of object from Action Creator. By returning a function we can directly access to the dispatch function. And inside of this function we can make any async requests, actions. So we can dispatch action anytime we want.

CORS

User on the website which has its own domain, sub-domain, port tries to make AJAX Request to different domain, sub-domain, port.

The purpose of CORS is soly for protecting the users in the browser

LocalStorage

LocalStorage data is not shared across domains.

Dispatch

The same one with Redux Thunk dispatch is the property of Redux store 's dispatch.

Big solution for updating our app states before rendering any Components.

react.auth.server.exercise's People

Contributors

zerofruit avatar

Watchers

James Cloos 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.