X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fauth%2Foauth.ts;h=2bf7a63617e935b105d6b0039486c396084a884e;hb=e5540d2760f7dba7a2e81c78938558c8991e619d;hp=5b6130d567301d802ea49292b508911e38ad4395;hpb=dc48fdbe68e9dd3a3a6028181e61d8595d98e654;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/auth/oauth.ts b/server/lib/auth/oauth.ts index 5b6130d56..2bf7a6361 100644 --- a/server/lib/auth/oauth.ts +++ b/server/lib/auth/oauth.ts @@ -1,4 +1,4 @@ -import * as express from 'express' +import express from 'express' import { InvalidClientError, InvalidGrantError, @@ -8,8 +8,9 @@ import { UnauthorizedClientError, UnsupportedGrantTypeError } from 'oauth2-server' -import { randomBytesPromise, sha1 } from '@server/helpers/core-utils' +import { randomBytesPromise } from '@server/helpers/core-utils' import { MOAuthClient } from '@server/types/models' +import { sha1 } from '@shared/extra-utils' import { OAUTH_LIFETIME } from '../../initializers/constants' import { BypassLogin, getClient, getRefreshToken, getUser, revokeToken, saveToken } from './oauth-model' @@ -81,7 +82,7 @@ async function handleOAuthToken (req: express.Request, options: { refreshTokenAu }) } -async function handleOAuthAuthenticate ( +function handleOAuthAuthenticate ( req: express.Request, res: express.Response, authenticateInQuery = false