Skip to content

Commit

Permalink
add typescript types
Browse files Browse the repository at this point in the history
  • Loading branch information
jbarrus committed Oct 9, 2019
1 parent 559d4ac commit 222ad6f
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 0 deletions.
24 changes: 24 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Type definitions for express-openid-connect

import { AuthorizationParameters, TokenSet } from 'openid-client';
import { Request, RequestHandler } from 'express';

interface AuthParams {
issuerBaseURL?: string;
baseURL?: string;
clientID?: string;
clientSecret?: string;
clockTolerance?: number;
getUser?: (tokenSet: TokenSet) => any;
required?: boolean | ((request: Request) => boolean);
errorOnRequiredAuth?: boolean;
idpLogout?: boolean;
auth0Logout?: boolean;
routes?: boolean;
redirectUriPath?: string;
authorizationParams?: AuthorizationParameters
}

export function auth(params?: AuthParams): RequestHandler;
export function requiresAuth(): RequestHandler;
export function unauthorizedHandler(): RequestHandler;
68 changes: 68 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"url-join": "^4.0.1"
},
"devDependencies": {
"@types/express": "^4.17.1",
"body-parser": "^1.19.0",
"chai": "^4.2.0",
"cookie-session": "^2.0.0-beta.3",
Expand Down

0 comments on commit 222ad6f

Please sign in to comment.