1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 10:19:35 +02:00

Refactor auth flow

Reimplement some node-oauth2-server methods to remove hacky code needed by our external
login workflow
This commit is contained in:
Chocobozzz 2021-03-12 15:20:46 +01:00
parent cae2df6bdc
commit f43db2f46e
No known key found for this signature in database
GPG key ID: 583A612D890159BE
24 changed files with 487 additions and 255 deletions

View file

@ -1,15 +1,15 @@
import * as express from 'express'
import { PLUGIN_GLOBAL_CSS_PATH } from '../initializers/constants'
import { join } from 'path'
import { PluginManager, RegisteredPlugin } from '../lib/plugins/plugin-manager'
import { getPluginValidator, pluginStaticDirectoryValidator, getExternalAuthValidator } from '../middlewares/validators/plugins'
import { serveThemeCSSValidator } from '../middlewares/validators/themes'
import { HttpStatusCode } from '../../shared/core-utils/miscs/http-error-codes'
import { logger } from '@server/helpers/logger'
import { optionalAuthenticate } from '@server/middlewares/auth'
import { getCompleteLocale, is18nLocale } from '../../shared/core-utils/i18n'
import { HttpStatusCode } from '../../shared/core-utils/miscs/http-error-codes'
import { PluginType } from '../../shared/models/plugins/plugin.type'
import { isTestInstance } from '../helpers/core-utils'
import { logger } from '@server/helpers/logger'
import { optionalAuthenticate } from '@server/middlewares/oauth'
import { PLUGIN_GLOBAL_CSS_PATH } from '../initializers/constants'
import { PluginManager, RegisteredPlugin } from '../lib/plugins/plugin-manager'
import { getExternalAuthValidator, getPluginValidator, pluginStaticDirectoryValidator } from '../middlewares/validators/plugins'
import { serveThemeCSSValidator } from '../middlewares/validators/themes'
const sendFileOptions = {
maxAge: '30 days',