diff --git a/keyserver/src/emails/access-request.js b/keyserver/src/emails/access-request.js deleted file mode 100644 --- a/keyserver/src/emails/access-request.js +++ /dev/null @@ -1,45 +0,0 @@ -// @flow - -import _shuffle from 'lodash/fp/shuffle'; -import React from 'react'; -import { Item, Span, renderEmail } from 'react-html-email'; - -import ashoat from 'lib/facts/ashoat'; -import type { AccessRequest } from 'lib/types/account-types'; - -import sendmail from './sendmail'; -import Template from './template.react'; - -const someHeadings = [ - 'What is UP my man??', - 'Ayy this that code you wrote', - 'I am a digital extension of your self', - 'We got some news, bud-dy!', -]; - -async function sendAccessRequestEmailToAshoat( - request: AccessRequest, -): Promise { - const heading = _shuffle(someHeadings)[0]; - const title = 'Somebody wants SquadCal!'; - const email = ( - - ); - const html = renderEmail(email); - - await sendmail.sendMail({ - from: 'no-reply@squadcal.org', - to: ashoat.landing_email, - subject: title, - html, - }); -} - -export { sendAccessRequestEmailToAshoat }; diff --git a/keyserver/src/endpoints.js b/keyserver/src/endpoints.js --- a/keyserver/src/endpoints.js +++ b/keyserver/src/endpoints.js @@ -49,7 +49,6 @@ accountCreationResponder, logInResponder, oldPasswordUpdateResponder, - requestAccessResponder, updateUserSettingsResponder, } from './responders/user-responders'; import { codeVerificationResponder } from './responders/verification-responders'; @@ -78,7 +77,6 @@ log_in: logInResponder, log_out: logOutResponder, remove_members: memberRemovalResponder, - request_access: requestAccessResponder, restore_entry: entryRestorationResponder, search_users: userSearchResponder, send_password_reset_email: sendPasswordResetEmailResponder, diff --git a/keyserver/src/responders/user-responders.js b/keyserver/src/responders/user-responders.js --- a/keyserver/src/responders/user-responders.js +++ b/keyserver/src/responders/user-responders.js @@ -13,7 +13,6 @@ LogInResponse, LogInRequest, UpdatePasswordRequest, - AccessRequest, UpdateUserSettingsRequest, } from 'lib/types/account-types'; import { @@ -32,7 +31,6 @@ import { tShape, tPlatformDetails, - tDeviceType, tPassword, tEmail, tOldValidUsername, @@ -42,7 +40,6 @@ import { dbQuery, SQL } from '../database/database'; import { deleteAccount } from '../deleters/account-deleters'; import { deleteCookie } from '../deleters/cookie-deleters'; -import { sendAccessRequestEmailToAshoat } from '../emails/access-request'; import { fetchEntryInfos } from '../fetchers/entry-fetchers'; import { fetchMessageInfos } from '../fetchers/message-fetchers'; import { fetchThreadInfos } from '../fetchers/thread-fetchers'; @@ -307,21 +304,6 @@ return await updatePassword(viewer, request); } -const accessRequestInputValidator = tShape({ - email: tEmail, - platform: tDeviceType, -}); - -async function requestAccessResponder( - viewer: Viewer, - input: any, -): Promise { - const request: AccessRequest = input; - await validateInput(viewer, accessRequestInputValidator, request); - - await sendAccessRequestEmailToAshoat(request); -} - const updateUserSettingsInputValidator = tShape({ name: t.irreducible( userSettingsTypes.DEFAULT_NOTIFICATIONS, @@ -349,6 +331,5 @@ accountCreationResponder, logInResponder, oldPasswordUpdateResponder, - requestAccessResponder, updateUserSettingsResponder, }; diff --git a/lib/actions/user-actions.js b/lib/actions/user-actions.js --- a/lib/actions/user-actions.js +++ b/lib/actions/user-actions.js @@ -7,7 +7,6 @@ LogInResult, RegisterResult, RegisterInfo, - AccessRequest, UpdateUserSettingsRequest, } from '../types/account-types'; import type { GetSessionPublicKeysArgs } from '../types/request-types'; @@ -208,17 +207,6 @@ }; }; -const requestAccessActionTypes = Object.freeze({ - started: 'REQUEST_ACCESS_STARTED', - success: 'REQUEST_ACCESS_SUCCESS', - failed: 'REQUEST_ACCESS_FAILED', -}); -const requestAccess = ( - fetchJSON: FetchJSON, -): ((accessRequest: AccessRequest) => Promise) => async accessRequest => { - await fetchJSON('request_access', accessRequest); -}; - const setUserSettingsActionTypes = Object.freeze({ started: 'SET_USER_SETTINGS_STARTED', success: 'SET_USER_SETTINGS_SUCCESS', @@ -256,8 +244,6 @@ logOutActionTypes, register, registerActionTypes, - requestAccess, - requestAccessActionTypes, searchUsers, searchUsersActionTypes, setUserSettings, diff --git a/lib/types/account-types.js b/lib/types/account-types.js --- a/lib/types/account-types.js +++ b/lib/types/account-types.js @@ -1,7 +1,7 @@ // @flow import { values } from '../utils/objects'; -import type { PlatformDetails, DeviceType } from './device-types'; +import type { PlatformDetails } from './device-types'; import type { CalendarQuery, CalendarResult, @@ -141,11 +141,6 @@ watchedIDs: $ReadOnlyArray, }; -export type AccessRequest = { - +email: string, - +platform: DeviceType, -}; - export type EmailSubscriptionRequest = { +email: string, };