Skip to content

Instantly share code, notes, and snippets.

@Zlob
Zlob / tokens.md
Created February 9, 2021 17:42 — forked from zmts/tokens.md
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
window.addEventListener("mousemove", function (e) {
var leftEye = headerEyes.getLeftEye();
var rightEye = headerEyes.getRightEye();
leftEye.eyeball.trackByCoordinate(e.x, e.y);
rightEye.eyeball.trackByCoordinate(e.x, e.y);
};
demoEyes.stopAnimation();
@Zlob
Zlob / animate.js
Last active February 4, 2017 20:20
demoEyes.animate(
options, // options, that need to be changed. Only numeric
duration
); //return Promise,
@Zlob
Zlob / emotions.js
Last active February 4, 2017 20:21
demoEyes.emote(
animationType, //one of the predefined emotions: 'angry', 'suspecting', 'happy', 'tempting', 'sad'
duration
);//return Promise,
var options = {
x : 0,
y : 0,
size : 50,
color : "#FFFFFF",
borderColor : "#000000",
borderSize : 5,
type : 'left', //left or right
//eyeball options
eyeball: {
var singleEye = eyes.createEye(
selector, //img selector
options, //eye options
);
var eyesPair = eyes.createEyesPair(
selector, //img selector
options, //eyes options
position, //eyes position, object like {x: 10, y:10}
distance // distance beetween eyes
);
function Rectangle( x, y, width, height, options ){
};
Rectangle.prototype.getCenter = function(){
return {
x: x + width/2,
y: y + height/2
};
}
function Rectangle( x, y, width, height, options ){
function getCenter(){
return {
x: x + width/2,
y: y + height/2
};
}