Last major update: 25.08.2020
- Что такое авторизация/аутентификация
- Где хранить токены
- Как ставить куки ?
- Процесс логина
- Процесс рефреш токенов
- Кража токенов/Механизм контроля токенов
| node_modules |
| const reg = new RegExp('(/' + namespace + '/)(.*)'); | |
| const partUrl = url.split(reg)[2]; |
When using findOrFail() or findOneOrFail() from typeORM, a 500 error is returned if there is no entity (EntityNotFoundError).
To make it returns a 404, use an exception filter as described in https://docs.nestjs.com/exception-filters .
file /src/filters/entity-not-found-exception.filter.ts
| const load = async (i18n, component) => { | |
| const messages = () => import('~/i18n/translations/' + i18n.locale + '/components/' + component); | |
| const componentMessages = await messages(); | |
| i18n.setLocaleMessage(i18n.locale, { | |
| ...i18n.messages[i18n.locale], | |
| testComponent: componentMessages.default | |
| }); |
| const purgecss = require('@fullhuman/postcss-purgecss')({ | |
| // Specify the paths to all of the template files in your project | |
| content: [ | |
| './src/**/*.html', | |
| './src/**/*.jsx', | |
| // etc. | |
| ], | |
| // Include any special characters you're using in this regular expression |
| import Vue from 'vue' | |
| import VueUniversalModal, { ModalWrapper } from 'vue-universal-modal' | |
| Vue.use(VueUniversalModal); | |
| Vue.component('ModalWrapper', ModalWrapper); | |
| // this.$modals.open({ | |
| // component: { | |
| // template: '<div>something like a DOM or the global vue component</div>' | |
| // }, |
| // Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/ | |
| // Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch | |
| // async function | |
| async function fetchAsync () { | |
| // await response of fetch call | |
| let response = await fetch('https://api.github.com'); | |
| // only proceed once promise is resolved | |
| let data = await response.json(); | |
| // only proceed once second promise is resolved |