diff --git a/src/app.ts b/src/app.ts index e6affeb7..c8cc0295 100644 --- a/src/app.ts +++ b/src/app.ts @@ -58,9 +58,10 @@ class App { this.express.use(cookieParser()) if (process.env.ENABLE_AUTHENTICATION === 'true') { this.express.use(session({secret: process.env.COOKIE_SECRET, cookie: { maxAge: 14 * 24 * 60 * 60 }})) + // Authentication funcitons/methods + this.express.use(Authentication.wrapperHandleAuthRoutes) this.express.use(Authentication.withLogtoWrapper) this.express.use(Authentication.guard) - this.express.use(Authentication.wrapperHandleAuthRoutes) } this.express.use(express.text()) diff --git a/src/types/constants.ts b/src/types/constants.ts index 7ad3c8ba..7120598e 100644 --- a/src/types/constants.ts +++ b/src/types/constants.ts @@ -1,10 +1,8 @@ -import { ReservedScope, UserScope } from '@logto/express' import * as dotenv from 'dotenv' dotenv.config() -const {ALL_API_RESOURCES, - LOGTO_ENDPOINT, - LOGTO_DEFAULT_RESOURCE_URL, +const { + LOGTO_ENDPOINT, LOGTO_APP_ID, LOGTO_APP_SECRET, APPLICATION_BASE_URL} = process.env diff --git a/src/types/environment.d.ts b/src/types/environment.d.ts index 60c69f09..91f87c63 100644 --- a/src/types/environment.d.ts +++ b/src/types/environment.d.ts @@ -28,7 +28,6 @@ declare global { LOGTO_M2M_APP_ID: string LOGTO_M2M_APP_SECRET: string LOGTO_MANAGEMENT_API: string - ALL_API_RESOURCES: string // Authentication ENABLE_AUTHENTICATION: string | "false"