aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/auth/oauth.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/auth/oauth.ts')
-rw-r--r--server/lib/auth/oauth.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/server/lib/auth/oauth.ts b/server/lib/auth/oauth.ts
index 2bf7a6361..fa1887315 100644
--- a/server/lib/auth/oauth.ts
+++ b/server/lib/auth/oauth.ts
@@ -1,5 +1,5 @@
1import express from 'express' 1import express from 'express'
2import { 2import OAuth2Server, {
3 InvalidClientError, 3 InvalidClientError,
4 InvalidGrantError, 4 InvalidGrantError,
5 InvalidRequestError, 5 InvalidRequestError,
@@ -7,7 +7,7 @@ import {
7 Response, 7 Response,
8 UnauthorizedClientError, 8 UnauthorizedClientError,
9 UnsupportedGrantTypeError 9 UnsupportedGrantTypeError
10} from 'oauth2-server' 10} from '@node-oauth/oauth2-server'
11import { randomBytesPromise } from '@server/helpers/core-utils' 11import { randomBytesPromise } from '@server/helpers/core-utils'
12import { MOAuthClient } from '@server/types/models' 12import { MOAuthClient } from '@server/types/models'
13import { sha1 } from '@shared/extra-utils' 13import { sha1 } from '@shared/extra-utils'
@@ -19,8 +19,7 @@ import { BypassLogin, getClient, getRefreshToken, getUser, revokeToken, saveToke
19 * Reimplement some functions of OAuth2Server to inject external auth methods 19 * Reimplement some functions of OAuth2Server to inject external auth methods
20 * 20 *
21 */ 21 */
22 22const oAuthServer = new OAuth2Server({
23const oAuthServer = new (require('oauth2-server'))({
24 accessTokenLifetime: OAUTH_LIFETIME.ACCESS_TOKEN, 23 accessTokenLifetime: OAUTH_LIFETIME.ACCESS_TOKEN,
25 refreshTokenLifetime: OAUTH_LIFETIME.REFRESH_TOKEN, 24 refreshTokenLifetime: OAUTH_LIFETIME.REFRESH_TOKEN,
26 25