Remove backward compatibility (peertubeHelpers.user.getAuthUser always available).

This commit is contained in:
John Livingston
2021-06-02 14:07:12 +02:00
parent 6f57931a9d
commit 228a60ca3a
3 changed files with 5 additions and 23 deletions

View File

@ -3,7 +3,7 @@ import { videoHasWebchat } from '../../../shared/lib/video'
import { asyncMiddleware } from '../middlewares/async'
import { getCheckAPIKeyMiddleware } from '../middlewares/apikey'
import { prosodyCheckUserPassword, prosodyRegisterUser, prosodyUserRegistered } from '../prosody/auth'
import { getAuthUser, getUserNickname } from '../helpers'
import { getUserNickname } from '../helpers'
import { Affiliations, getVideoAffiliations } from '../prosody/config/affiliations'
import { getProsodyDomain } from '../prosody/config/domain'
@ -92,7 +92,7 @@ async function initApiRouter (options: RegisterServerOptions): Promise<Router> {
router.get('/auth', asyncMiddleware(
async (req: Request, res: Response, _next: NextFunction) => {
const user = await getAuthUser(options, res)
const user = await peertubeHelpers.user.getAuthUser(res)
if (!user) {
res.sendStatus(403)
return