diff options
Diffstat (limited to 'server/lib/auth/oauth.ts')
-rw-r--r-- | server/lib/auth/oauth.ts | 7 |
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 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { | 2 | import 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' |
11 | import { randomBytesPromise } from '@server/helpers/core-utils' | 11 | import { randomBytesPromise } from '@server/helpers/core-utils' |
12 | import { MOAuthClient } from '@server/types/models' | 12 | import { MOAuthClient } from '@server/types/models' |
13 | import { sha1 } from '@shared/extra-utils' | 13 | import { 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 | 22 | const oAuthServer = new OAuth2Server({ | |
23 | const 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 | ||