Last major update: 25.08.2020
- Что такое авторизация/аутентификация
- Где хранить токены
- Как ставить куки ?
- Процесс логина
- Процесс рефреш токенов
- Кража токенов/Механизм контроля токенов
| /** | |
| * Shunting yard algorithm | |
| * See: http://en.wikipedia.org/wiki/Shunting_yard_algorithm | |
| * | |
| * Converts infix notation to postfix notation | |
| * | |
| * by Dmitry Soshnikov <dmitry.soshnikov@gmail.com> | |
| * MIT Style License | |
| * | |
| * (C) 2011, updated on 2020 |
| license: gpl-3.0 |
| // Shunting-yard Algorithm | |
| // https://en.wikipedia.org/wiki/Shunting-yard_algorithm | |
| // | |
| // Implementation notes for unary operators by Austin Taylor | |
| // https://stackoverflow.com/a/5240912 | |
| // | |
| // Example: | |
| // https://ideone.com/VocUTq | |
| // | |
| // License: |
| .mono-font-stack { | |
| font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; | |
| } | |
| .times-font-stack { | |
| font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif; | |
| } | |
| .modern-font-stack { | |
| font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif," "Bitstream Vera Serif", "Liberation Serif", Georgia, serif; |
| import express from 'express' | |
| import bodyParser from 'body-parser' | |
| import cookieParser from 'cookie-parser' | |
| import passport from 'passport' | |
| import passportJWT, { ExtractJwt, Strategy as JwtStrategy } from 'passport-jwt' | |
| import bcrypt from 'bcrypt' | |
| import jwt from 'jsonwebtoken' | |
| const { fromExtractors, fromAuthHeaderWithScheme, fromAuthHeaderAsBearerToken } = ExtractJwt |
Thanks everyone for commenting/contributing! I made this in college for a class and I no longer really use the technology. I encourage you all to help each other, but I probably won't be answering questions anymore.
This article is also on my blog, too.
Note: $ denotes the start of a command. Don't actually type this.
x86_64.sh. If I had a 32-bit computer, I'd select the x86.sh version. If you accidentally try to install the wrong one, you'll get a warning in the terminal. I chose `Ana:root {
/* Base color using HSL */
--hue: 207;
--saturation: 64%;
--light: 44%;
/* Base color in variable */
--primary-color: hsl(var(--hue), var(--saturation), var(--light));
/* Base color lighten using calc */| import * as React from "react" | |
| import { useState, useEffect } from "react" | |
| // Hook | |
| let cachedScripts = [] | |
| export function useScript(src) { | |
| // Keeping track of script loaded and error state | |
| const [state, setState] = useState({ | |
| loaded: false, |