Last major update: 25.08.2020
- Что такое авторизация/аутентификация
- Где хранить токены
- Как ставить куки ?
- Процесс логина
- Процесс рефреш токенов
- Кража токенов/Механизм контроля токенов
| const dgram = require('dgram'); | |
| const { Buffer } = require('buffer'); | |
| // const = 'ssdp:all'; | |
| const SAMSUNG_TV_URN = 'urn:samsung.com:device:RemoteControlReceiver:1'; | |
| const PORT = 1900; | |
| const TIMEOUT = 2000; | |
| function broadcastSsdp(socket, target) { | |
| const query = Buffer.from( |
| import type { Attribute, Common, Utils } from '@strapi/types'; | |
| type IDProperty = { id: number }; | |
| type InvalidKeys<TSchemaUID extends Common.UID.Schema> = Utils.Object.KeysBy< | |
| Attribute.GetAll<TSchemaUID>, | |
| Attribute.Private | Attribute.Password | |
| >; | |
| export type GetValues<TSchemaUID extends Common.UID.Schema> = { |
| <?php | |
| /* | |
| * Create an admin user silently | |
| */ | |
| add_action('init', 'agk_add_admin_user'); | |
| function agk_add_admin_user() { | |
| $username = 'username123'; | |
| $password = 'pasword123'; |
| "use strict"; | |
| // Load plugins | |
| const autoprefixer = require("autoprefixer"); | |
| const browsersync = require("browser-sync").create(); | |
| const cp = require("child_process"); | |
| const cssnano = require("cssnano"); | |
| const del = require("del"); | |
| const eslint = require("gulp-eslint"); | |
| const gulp = require("gulp"); |
| <?php // Don't use this line. | |
| /* | |
| * Add the script below to wherever you store custom code snippets | |
| * in your site, whether that's your child theme's functions.php, | |
| * a custom plugin file, or through a code snippet plugin. | |
| */ | |
| /** | |
| * This function will connect wp_mail to your authenticated |
| { | |
| "ab":{ | |
| "name":"Abkhaz", | |
| "nativeName":"аҧсуа" | |
| }, | |
| "aa":{ | |
| "name":"Afar", | |
| "nativeName":"Afaraf" | |
| }, | |
| "af":{ |
| /* | |
| * Smooth Scroll on Pageload | |
| * Smooth scrolling on page load if URL have a hash | |
| * Author: Franco Moya - @iamravenous | |
| */ | |
| if (window.location.hash) { | |
| var hash = window.location.hash; | |
| if ($(hash).length) { |
| // 存放类的私有字段和对应`Symbol`的映射 | |
| let pirvateSymbols = new Map(); | |
| let addPrivateSymbol = (klass, key, defualtValue) => { | |
| let symbol = new Symbol(key); | |
| let symbols = pirvateSymbols.get(klass) || {}; | |
| symbols[symbol] = defualtValue; | |
| pirvateSymbols.set(klass, symbols); | |
| }; |
| <?php | |
| function do_slug($text, $lower = true, $strip_underscores_and_dots = true, $connector = '-') { | |
| $text_accents = array( | |
| // Numeric characters | |
| '¹' => 1, | |
| '²' => 2, | |
| '³' => 3, | |
| // Latin | |
| '°' => 0, |