@timshel_npm/maildev
Version:
SMTP Server with async API and Web Interface for viewing and testing emails during development
17 lines (16 loc) • 557 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createOnAuthCallback = createOnAuthCallback;
/**
* Authorize callback for smtp server
*/
function createOnAuthCallback(username, password) {
return function onAuth(auth, session, callback) {
if (auth.username && auth.password) {
if (auth.username !== username || auth.password !== password) {
return callback(new Error("Invalid username or password"));
}
}
callback(null, { user: username });
};
}