Add basic auth middleware
This commit is contained in:
parent
11cacc5e35
commit
8a2d98c67a
|
@ -0,0 +1,8 @@
|
|||
import basicAuth from 'express-basic-auth';
|
||||
|
||||
export default function basicAuthHandler(username : string, password : string) {
|
||||
return basicAuth({
|
||||
authorizer: (req_username : string, req_password : string) => req_username === username && req_password === password,
|
||||
challenge: true
|
||||
});
|
||||
}
|
|
@ -2,3 +2,4 @@
|
|||
|
||||
declare module 'express-ip-access-control';
|
||||
declare module 'connect-static-file';
|
||||
declare module 'express-basic-auth'
|
||||
|
|
Reference in New Issue