archive
/
tstatic
Archived
1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
tstatic/src/middleware/basic-auth.ts

10 lines
318 B
TypeScript

import * as basicAuth from 'express-basic-auth';
export default function basicAuthHandler(username: string, password: string) {
return basicAuth({
authorizer:
(reqUsername: string, reqPassword: string) => reqUsername === username && reqPassword === password,
challenge: true
});
}