Last major update: 25.08.2020
- Что такое авторизация/аутентификация
- Где хранить токены
- Как ставить куки ?
- Процесс логина
- Процесс рефреш токенов
- Кража токенов/Механизм контроля токенов
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
from django.db import migrations | |
from django.contrib.auth.admin import User | |
def create_superuser(apps, schema_editor): | |
superuser = User() | |
superuser.is_active = True |
function fetchJSON(url, options, callback) { | |
if (typeof options === 'function') { | |
callback = options | |
options = {} | |
} | |
options = options || {} | |
const headers = (options.headers || (options.headers = {})) | |
headers.Accept = 'application/json' |
The package that linked you here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
import foo from 'foo'
instead of const foo = require('foo')
to import the package. You also need to put "type": "module"
in your package.json and more. Follow the below guide.await import(…)
from CommonJS instead of require(…)
.