-import * as express from 'express'
+import express from 'express'
import {
InvalidClientError,
InvalidGrantError,
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'
})
}
-async function handleOAuthAuthenticate (
+function handleOAuthAuthenticate (
req: express.Request,
res: express.Response,
authenticateInQuery = false