diff options
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/ActionUtilities.ts | 6 | ||||
| -rw-r--r-- | src/server/DashSession/DashSessionAgent.ts | 4 | ||||
| -rw-r--r-- | src/server/authentication/AuthenticationManager.ts | 12 | ||||
| -rw-r--r-- | src/server/websocket.ts | 16 |
4 files changed, 22 insertions, 16 deletions
diff --git a/src/server/ActionUtilities.ts b/src/server/ActionUtilities.ts index fd9bc0c83..d237869ed 100644 --- a/src/server/ActionUtilities.ts +++ b/src/server/ActionUtilities.ts @@ -114,8 +114,8 @@ export namespace Email { const smtpTransport = nodemailer.createTransport({ service: 'Gmail', auth: { - user: 'brownptcdash@gmail.com', - pass: 'browngfx1' + user: 'browndashptc@gmail.com', + pass: 'TsarNicholas#2' } }); @@ -149,7 +149,7 @@ export namespace Email { export async function dispatch({ to, subject, content, attachments }: DispatchOptions<string>): Promise<Error | null> { const mailOptions = { to, - from: 'brownptcdash@gmail.com', + from: 'browndashptc@gmail.com', subject, text: `Hello ${to.split("@")[0]},\n\n${content}`, attachments diff --git a/src/server/DashSession/DashSessionAgent.ts b/src/server/DashSession/DashSessionAgent.ts index 5a23f8216..a094b3781 100644 --- a/src/server/DashSession/DashSessionAgent.ts +++ b/src/server/DashSession/DashSessionAgent.ts @@ -127,7 +127,7 @@ export class DashSessionAgent extends AppliedSessionAgent { /** * Logic for interfacing with Solr. Either starts it, - * stops it, or rebuilds its indicies. + * stops it, or rebuilds its indices. */ private executeSolrCommand = async (args: string[]): Promise<void> => { const { exec, mainLog } = this.sessionMonitor; @@ -224,6 +224,6 @@ export class DashSessionAgent extends AppliedSessionAgent { export namespace DashSessionAgent { - export const notificationRecipient = "brownptcdash@gmail.com"; + export const notificationRecipient = "browndashptc@gmail.com"; } diff --git a/src/server/authentication/AuthenticationManager.ts b/src/server/authentication/AuthenticationManager.ts index 9eb4a328f..3fbd4b3a7 100644 --- a/src/server/authentication/AuthenticationManager.ts +++ b/src/server/authentication/AuthenticationManager.ts @@ -177,13 +177,13 @@ export let postForgot = function (req: Request, res: Response, next: NextFunctio const smtpTransport = nodemailer.createTransport({ service: 'Gmail', auth: { - user: 'brownptcdash@gmail.com', - pass: 'browngfx1' + user: 'browndashptc@gmail.com', + pass: 'TsarNicholas#2' } }); const mailOptions = { to: user.email, - from: 'brownptcdash@gmail.com', + from: 'browndashptc@gmail.com', subject: 'Dash Password Reset', text: 'You are receiving this because you (or someone else) have requested the reset of the password for your account.\n\n' + 'Please click on the following link, or paste this into your browser to complete the process:\n\n' + @@ -250,13 +250,13 @@ export let postReset = function (req: Request, res: Response) { const smtpTransport = nodemailer.createTransport({ service: 'Gmail', auth: { - user: 'brownptcdash@gmail.com', - pass: 'browngfx1' + user: 'browndashptc@gmail.com', + pass: 'TsarNicholas#2' } }); const mailOptions = { to: user.email, - from: 'brownptcdash@gmail.com', + from: 'browndashptc@gmail.com', subject: 'Your password has been changed', text: 'Hello,\n\n' + 'This is a confirmation that the password for your account ' + user.email + ' has just been changed.\n' diff --git a/src/server/websocket.ts b/src/server/websocket.ts index f2f86bdb9..9103af156 100644 --- a/src/server/websocket.ts +++ b/src/server/websocket.ts @@ -210,9 +210,12 @@ export namespace WebSocket { } } + function GetRefFieldLocal([id, callback]: [string, (result?: Transferable) => void]) { + return Database.Instance.getDocument(id, callback); + } function GetRefField([id, callback]: [string, (result?: Transferable) => void]) { process.stdout.write(`.`); - Database.Instance.getDocument(id, callback); + GetRefFieldLocal([id, callback]); } function GetRefFields([ids, callback]: [string[], (result?: Transferable[]) => void]) { @@ -278,8 +281,8 @@ export namespace WebSocket { diff.diff.$set = diff.diff.$addToSet; delete diff.diff.$addToSet;// convert add to set to a query of the current fields, and then a set of the composition of the new fields with the old ones const updatefield = Array.from(Object.keys(diff.diff.$set))[0]; const newListItems = diff.diff.$set[updatefield].fields; - const curList = (curListItems as any)?.fields?.[updatefield.replace("fields.", "")]?.fields || []; - diff.diff.$set[updatefield].fields = [...curList, ...newListItems.filter((newItem: any) => !curList.some((curItem: any) => curItem.fieldId ? curItem.fieldId === newItem.fieldId : curItem.heading ? curItem.heading === newItem.heading : curItem === newItem))]; + const curList = (curListItems as any)?.fields?.[updatefield.replace("fields.", "")]?.fields.filter((item: any) => item !== undefined) || []; + diff.diff.$set[updatefield].fields = [...curList, ...newListItems.filter((newItem: any) => newItem && !curList.some((curItem: any) => curItem.fieldId ? curItem.fieldId === newItem.fieldId : curItem.heading ? curItem.heading === newItem.heading : curItem === newItem))]; const sendBack = diff.diff.length !== diff.diff.$set[updatefield].fields.length; delete diff.diff.length; Database.Instance.update(diff.id, diff.diff, @@ -314,8 +317,11 @@ export namespace WebSocket { function UpdateField(socket: Socket, diff: Diff) { - if (diff.diff.$addToSet) return GetRefField([diff.id, (result?: Transferable) => addToListField(socket, diff, result)]); // would prefer to have Mongo handle list additions direclty, but for now handle it on our own - if (diff.diff.$remFromSet) return GetRefField([diff.id, (result?: Transferable) => remFromListField(socket, diff, result)]); // would prefer to have Mongo handle list additions direclty, but for now handle it on our own + if (diff.diff.$addToSet) return GetRefFieldLocal([diff.id, (result?: Transferable) => addToListField(socket, diff, result)]); // would prefer to have Mongo handle list additions direclty, but for now handle it on our own + if (diff.diff.$remFromSet) return GetRefFieldLocal([diff.id, (result?: Transferable) => remFromListField(socket, diff, result)]); // would prefer to have Mongo handle list additions direclty, but for now handle it on our own + return GetRefFieldLocal([diff.id, (result?: Transferable) => SetField(socket, diff, result)]); + } + function SetField(socket: Socket, diff: Diff, curListItems?: Transferable) { Database.Instance.update(diff.id, diff.diff, () => socket.broadcast.emit(MessageStore.UpdateField.Message, diff), false); const docfield = diff.diff.$set || diff.diff.$unset; |
