Last major update: 25.08.2020
- Что такое авторизация/аутентификация
- Где хранить токены
- Как ставить куки ?
- Процесс логина
- Процесс рефреш токенов
- Кража токенов/Механизм контроля токенов
| import React from 'react'; | |
| import PropTypes from 'prop-types'; | |
| import moment from 'moment'; | |
| import { connect } from 'react-redux'; | |
| import * as actions from 'actions/cards'; | |
| import { activateCardStep1Validate, activateCardStep2Validate } from 'utils/validate'; | |
| import { API_BIRTHDATE_FORMAT } from 'utils/constants'; | |
| import Modal, { ModalContent } from 'components/Modal'; | |
| import Wizard from 'components/Wizard'; |
| RUN curl -o ioncube.tar.gz http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz \ | |
| && tar -xvvzf ioncube.tar.gz \ | |
| && mv ioncube/ioncube_loader_lin_5.6.so `php-config --extension-dir` \ | |
| && rm -Rf ioncube.tar.gz ioncube \ | |
| && docker-php-ext-enable ioncube_loader_lin_5.6 |
| module.exports = { | |
| parserOptions: { | |
| ecmaVersion: 7, | |
| sourceType: 'module', | |
| ecmaFeatures: { | |
| jsx: true, | |
| experimentalObjectRestSpread: true | |
| } | |
| }, |
| /** | |
| * Stand alone polyfill allow only numbers on input of type number. | |
| * | |
| * While input filtering is already supported by default by some browsers, maximum length has not been implemented by | |
| * any. This script will solve both issue and make sure that only digits can be entered in input elements of type | |
| * number. If the optional attribute `max` is set, it will calculate it's length and mimic the `maxlength` behavior on | |
| * input of type text. | |
| * | |
| * Supports: | |
| * |
| /* Sometimes it's pretty easy to run ito troubles with React ES6 components. | |
| Consider the following code: */ | |
| class EventStub extends Component { | |
| componentDidMount() { | |
| window.addEventListener('resize', this.onResize.bind(this)); //notice .bind | |
| } | |
| componentWillUnmount() { | |
| window.removeEventListener('resize', this.onResize.bind(this)); |
| @function up-to($list, $index) { | |
| $l: (); | |
| @each $e in $list { | |
| @if length($l) < $index { | |
| $l: append($l, $e, list-separator($list)); | |
| } | |
| } | |
| @return $l; | |
| } |
| function processBodyChunkwiseWithProgress(res, processChunk) { | |
| const dummyEventTarget = document.createElement("div"); // why isn't EventTarget constructible? :( | |
| const lengthComputable = res.headers.has("Content-Length"); | |
| const total = res.headers.get("Content-Length") || 0; | |
| let loaded = 0; | |
| // Using http://underscorejs.org/#throttle | |
| const fireProgressThrottled = _.throttle(fireProgress, 50, { trailing: false }); |
react + redux + RR
It uses https://gist.github.com/iNikNik/3c1b870f63dc0de67c38 for stores and actions.
1) create redux
const redux = createRedux(state);2) get requireAccess func => bindCheckAuth to redux