Skip to content

Commit be927e0

Browse files
authored
feat(ts): expose ExpressAuthConfig (#11096)
Update index.ts
1 parent d25aefe commit be927e0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/frameworks-express/src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ export type {
143143
User,
144144
} from "@auth/core/types"
145145

146-
export function ExpressAuth(config: Omit<AuthConfig, "raw">) {
146+
export type ExpressAuthConfig = Omit<AuthConfig, "raw">
147+
148+
export function ExpressAuth(config: ExpressAuthConfig) {
147149
return async (req: e.Request, res: e.Response, next: e.NextFunction) => {
148150
e.json()(req, res, async (err) => {
149151
if (err) return next(err)
@@ -166,7 +168,7 @@ export type GetSessionResult = Promise<Session | null>
166168

167169
export async function getSession(
168170
req: e.Request,
169-
config: Omit<AuthConfig, "raw">
171+
config: ExpressAuthConfig
170172
): GetSessionResult {
171173
setEnvDefaults(process.env, config)
172174
const url = createActionURL(

0 commit comments

Comments
 (0)