Last major update: 25.08.2020
- Что такое авторизация/аутентификация
- Где хранить токены
- Как ставить куки ?
- Процесс логина
- Процесс рефреш токенов
- Кража токенов/Механизм контроля токенов
| import React, { Component } from 'react'; | |
| import { WebView, BackHandler } from 'react-native'; | |
| export default class WebViewMoviezSpace extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.WEBVIEW_REF = React.createRef(); | |
| } | |
| componentDidMount() { |
| // Make sure to run the code using sudo as port 80 needs sudo access | |
| const http = require('http'); | |
| const server = http.createServer((req, res) => { | |
| res.writeHead(301,{Location: `https://${req.headers.host}${req.url}`}); | |
| res.end(); | |
| }); | |
| server.listen(80); |
| CREATE TABLE tone_data_temp AS | |
| SELECT file_name, last_update, category, word_count, litigious, | |
| positive, uncertainty, negative, modal_strong, modal_weak | |
| FROM bgt.tone_data; | |
| DROP TABLE bgt.tone_data; | |
| ALTER TABLE tone_data_temp RENAME TO tone_data; | |
| ALTER TABLE tone_data SET SCHEMA bgt; |
| import { combineReducers } from 'redux'; | |
| import users from './reducers/users'; | |
| import posts from './reducers/posts'; | |
| export default function createReducer(asyncReducers) { | |
| return combineReducers({ | |
| users, | |
| posts, | |
| ...asyncReducers | |
| }); |
| const shuffle = arr => | |
| arr.reduce((arr, elt) => { | |
| arr.splice(~~(Math.random() * (arr.length + 1)), 0, elt) | |
| return arr | |
| }, []) |
| { | |
| "scripts": { | |
| "eslint": "LIST=`git diff-index --name-only HEAD | grep .*\\.js | grep -v json`; if [ \"$LIST\" ]; then eslint $LIST; fi" | |
| }, | |
| "devDependencies": { | |
| "pre-commit": "0.0.7", | |
| "eslint": "~0.5.1" | |
| }, | |
| "pre-commit": [ | |
| "eslint" |
| # Клонируем исходный репозиторий без рабочего каталога (--bare) | |
| git clone --bare https://github.com/exampleuser/old-repository.git | |
| cd old-repository.git | |
| # Делаем mirror-push(будут скопированы все ветки и тэги) в новый репозиторий | |
| git push --mirror https://github.com/exampleuser/new-repository.git | |
| cd .. | |
| # Удаляем папку с репозиторием |