chore: Add authentication interface and adjust authentication classes

This commit is contained in:
Faruk AYDIN
2022-03-01 15:14:56 +03:00
committed by Ali BARIN
parent a506d1985f
commit b2369fa8cd
14 changed files with 144 additions and 93 deletions

View File

@@ -1,11 +1,13 @@
import nodemailer from 'nodemailer';
import nodemailer, { Transporter, TransportOptions } from 'nodemailer';
import AppInfo from '../../types/app-info';
import JSONObject from '../../types/interfaces/json-object';
export default class Authentication {
appData: any;
connectionData: any;
client: any;
appData: AppInfo;
connectionData: JSONObject;
client: Transporter;
constructor(appData: any, connectionData: any) {
constructor(appData: AppInfo, connectionData: JSONObject) {
this.client = nodemailer.createTransport({
host: connectionData.host,
port: connectionData.port,
@@ -14,7 +16,7 @@ export default class Authentication {
user: connectionData.username,
pass: connectionData.password,
},
});
} as TransportOptions);
this.connectionData = connectionData;
this.appData = appData;