aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/auth/oauth-model.ts2
-rw-r--r--server/lib/auth/oauth.ts7
2 files changed, 4 insertions, 5 deletions
diff --git a/server/lib/auth/oauth-model.ts b/server/lib/auth/oauth-model.ts
index 910fdeec1..d9cf32827 100644
--- a/server/lib/auth/oauth-model.ts
+++ b/server/lib/auth/oauth-model.ts
@@ -1,5 +1,5 @@
1import express from 'express' 1import express from 'express'
2import { AccessDeniedError } from 'oauth2-server' 2import { AccessDeniedError } from '@node-oauth/oauth2-server'
3import { PluginManager } from '@server/lib/plugins/plugin-manager' 3import { PluginManager } from '@server/lib/plugins/plugin-manager'
4import { ActorModel } from '@server/models/actor/actor' 4import { ActorModel } from '@server/models/actor/actor'
5import { MOAuthClient } from '@server/types/models' 5import { MOAuthClient } from '@server/types/models'
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