Nitt Webmail Auth
1.0.0
Paquete JavaScript para autenticación de correo web para NIT-T
npm i nitt-webmail-auth
(async() =>{
/*
Arguments for Authenticator object:
{
publicUrl = "<>", // if you have an external endpoint for login
useWebmailDirectly = false, // If webmail servers are reachable, set this to true
imapPort = 993 // the port for imap
}
Returns:
true/false that indicates if the credentials are right or wrong, if useWebmailDirectly is set to true
(OR)
The response of the external endpoint, if useWebmailDirectly is set to false and PublicUrl is provided
*/
const authenticator = new Authenticator({ useWebmailDirectly: true });
const response = await authenticator.login({
username: "<>", // rollno/username, wihtout @nitt.edu
password: "<>",
pingBeforeLogin: true, // checks if the server is reachable
});
console.log(response);
})();
Nota: módulo ES6. Asegúrese de tener el "type" : "module"
en su paquete.json