diff --git a/client/package-lock.json b/client/package-lock.json index 2525c6b33..7080a7b91 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -4530,7 +4530,7 @@ }, "regjsgen": { "version": "0.2.0", - "resolved": "http://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", "dev": true }, @@ -4779,8 +4779,7 @@ "decode-uri-component": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" }, "deep-equal": { "version": "1.0.1", @@ -4924,7 +4923,7 @@ "dependencies": { "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true } @@ -5103,7 +5102,7 @@ "dependencies": { "domelementtype": { "version": "1.1.3", - "resolved": "http://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=" } } @@ -5700,7 +5699,7 @@ }, "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, @@ -7841,7 +7840,7 @@ "dependencies": { "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true } @@ -7994,7 +7993,7 @@ }, "fast-deep-equal": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", "dev": true }, @@ -8262,7 +8261,7 @@ }, "html-webpack-harddisk-plugin": { "version": "0.2.0", - "resolved": "http://registry.npmjs.org/html-webpack-harddisk-plugin/-/html-webpack-harddisk-plugin-0.2.0.tgz", + "resolved": "https://registry.npmjs.org/html-webpack-harddisk-plugin/-/html-webpack-harddisk-plugin-0.2.0.tgz", "integrity": "sha1-RlQUpTQhm2nB/YEntYX42GiX+y0=", "dev": true, "requires": { @@ -8301,7 +8300,7 @@ }, "htmlparser2": { "version": "3.3.0", - "resolved": "http://registry.npmjs.org/htmlparser2/-/htmlparser2-3.3.0.tgz", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.3.0.tgz", "integrity": "sha1-zHDQWln2VC5D8OaFyYLhTJJKnv4=", "dev": true, "requires": { @@ -9773,7 +9772,7 @@ }, "jest-get-type": { "version": "22.4.3", - "resolved": "http://registry.npmjs.org/jest-get-type/-/jest-get-type-22.4.3.tgz", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-22.4.3.tgz", "integrity": "sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w==", "dev": true }, @@ -10828,7 +10827,7 @@ }, "media-typer": { "version": "0.3.0", - "resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", "dev": true }, @@ -15844,7 +15843,7 @@ }, "fast-deep-equal": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", "dev": true }, @@ -16088,7 +16087,7 @@ }, "fast-deep-equal": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", "dev": true }, @@ -16420,7 +16419,6 @@ "version": "6.2.0", "resolved": "https://registry.npmjs.org/query-string/-/query-string-6.2.0.tgz", "integrity": "sha512-5wupExkIt8RYL4h/FE+WTg3JHk62e6fFPWtAZA9J5IWK1PfTfKkMS93HBUHcFpeYi9KsY5pFbh+ldvEyaz5MyA==", - "dev": true, "requires": { "decode-uri-component": "^0.2.0", "strict-uri-encode": "^2.0.0" @@ -17980,7 +17978,7 @@ }, "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, @@ -18790,7 +18788,7 @@ }, "safe-regex": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { @@ -20077,8 +20075,7 @@ "strict-uri-encode": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", - "integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY=", - "dev": true + "integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY=" }, "string-length": { "version": "2.0.0", @@ -20191,7 +20188,7 @@ }, "strip-eof": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, @@ -20364,7 +20361,7 @@ }, "tar": { "version": "2.2.1", - "resolved": "http://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", "dev": true, "requires": { @@ -22108,7 +22105,7 @@ "dependencies": { "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true } diff --git a/client/package.json b/client/package.json index d6043a57a..8ac2a391c 100644 --- a/client/package.json +++ b/client/package.json @@ -23,7 +23,7 @@ "devDependencies": { "@advancedalgos/events-client": "^0.0.4", "@advancedalgos/key-vault-client": "^0.0.21", - "@advancedalgos/teams-client": "^0.0.26", + "@advancedalgos/teams-client": "^0.0.27", "@advancedalgos/users-client": "^0.0.21", "@advancedalgos/web-components": "0.0.13", "@babel/core": "^7.1.2", @@ -90,6 +90,7 @@ "npm": "^6.4.1", "optimize-css-assets-webpack-plugin": "^5.0.1", "prop-types": "^15.6.2", + "query-string": "^6.2.0", "react": "^16.6.1", "react-apollo": "^2.2.4", "react-dom": "^16.6.1", diff --git a/client/src/App.js b/client/src/App.js index 206703826..58d5f4ec7 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -12,7 +12,7 @@ import './styles/styles.scss' import { client } from './graphql/apollo' import Auth from './auth' -import { Layout, Home, Charts, Callback } from './views' +import { Layout, Home, Charts, Callback, EmailSignupConfirm } from './views' import Users from '@advancedalgos/users-client' import Teams from '@advancedalgos/teams-client' @@ -39,6 +39,13 @@ export const MasterApp = (props) => ( return }} /> + { + console.log(props.location) + return + }} + /> } diff --git a/client/src/views/callback/index.js b/client/src/views/callback/index.js index 2dbf4c27f..01ae059fa 100644 --- a/client/src/views/callback/index.js +++ b/client/src/views/callback/index.js @@ -1,7 +1,12 @@ import React from 'react' -import { MessageCard } from '@advancedalgos/web-components' +import { BannerTopBar } from '../common' -const Callback = () => +const Callback = () => export default Callback diff --git a/client/src/views/charts/index.js b/client/src/views/charts/index.js index 9d9d7b308..29589ff2a 100644 --- a/client/src/views/charts/index.js +++ b/client/src/views/charts/index.js @@ -2,7 +2,7 @@ import React, { Component } from 'react' import { withStyles } from '@material-ui/core/styles' import { connect } from 'react-redux' -import BannerTopBar from '../BannerTopBar' +import { BannerTopBar } from '../common' const styles = theme => ({ '@global': { diff --git a/client/src/views/BannerTopBar/index.js b/client/src/views/common/components/BannerTopBar.js similarity index 61% rename from client/src/views/BannerTopBar/index.js rename to client/src/views/common/components/BannerTopBar.js index 255e9888d..823877f72 100644 --- a/client/src/views/BannerTopBar/index.js +++ b/client/src/views/common/components/BannerTopBar.js @@ -1,18 +1,29 @@ import React from 'react' +import PropTypes from 'prop-types' import Typography from '@material-ui/core/Typography' const BannerTopBar = ({ size, backgroundUrl, title, - text + text, + children }) => (
{title} {text} + {children}
) +BannerTopBar.propTypes = { + children: PropTypes.node, + backgroundUrl: PropTypes.string, + size: PropTypes.string, + title: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), + text: PropTypes.oneOfType([PropTypes.string, PropTypes.array]) +} + export default BannerTopBar diff --git a/client/src/views/common/index.js b/client/src/views/common/index.js new file mode 100644 index 000000000..9af9dc8f7 --- /dev/null +++ b/client/src/views/common/index.js @@ -0,0 +1,3 @@ +import BannerTopBar from './components/BannerTopBar' + +export { BannerTopBar } diff --git a/client/src/views/email-verification/components/SignupForm.js b/client/src/views/email-verification/components/SignupForm.js new file mode 100644 index 000000000..408fd5c3a --- /dev/null +++ b/client/src/views/email-verification/components/SignupForm.js @@ -0,0 +1,138 @@ +import React, { Component } from 'react' +import PropTypes from 'prop-types' +import { withStyles } from '@material-ui/core/styles' +import withWidth from '@material-ui/core/withWidth' +import { Mutation } from 'react-apollo' + +import Typography from '@material-ui/core/Typography' +import Grid from '@material-ui/core/Grid' +import Button from '@material-ui/core/Button' +import InputBase from '@material-ui/core/InputBase' + +import styles from './styles' + +import NEWSLETTER_SIGNUP from '../graphql/NewsletterSignup' + +import { isEmpty } from '../../../utils/js-helpers' + +export class SignupForm extends Component { + constructor (props) { + super(props) + + this.handleChange = this.handleChange.bind(this) + this.handleSubmit = this.handleSubmit.bind(this) + this.validate = this.validate.bind(this) + + this.state = { + email: '', + emailError: '', + success: false + } + } + + render () { + const { + classes, + width, + alignCenter, + displayTitle, + displayIntro + } = this.props + return ( + + {(NewsletterSignup, { loading, error, data }) => { + return ( + + {displayTitle && Stay in touch!} + {displayIntro && Opt-in our mailing list to stay up to date with the Advanced Algos Project.} +
+ + Thank you for signing up! Please check your email and click on the confirmation link to complete the signup process. + + + + + +
+
+ ) + }} +
+ ) + } + + validate (data) { + const errors = {} + switch (data.id) { + case 'email': + if (data.value === '') { + this.setState({ emailError: 'Please enter an email address' }) + } else { + this.setState({ emailError: '' }) + } + break + default: + } + return errors + } + + handleChange (e) { + let id = e.target.id + let value = e.target.value + let error = this.validate({ id, value }) + switch (id) { + case 'email': + if (!isEmpty(error)) this.setState({ emailError: error }) + this.setState({ email: value }) + break + default: + } + } + + async handleSubmit (e, NewsletterSignup) { + e.preventDefault() + console.log('NewsletterSignup handleSubmit: ', this.state.email) + const signupResponse = await NewsletterSignup({ variables: { email: this.state.email } }) + console.log('NewsletterSignup: ', signupResponse) + if (signupResponse.data.master_NewsletterSignup === 'SUCCESS') this.setState({ email: '', success: true }) + } +} + +SignupForm.propTypes = { + classes: PropTypes.object, + width: PropTypes.string, + alignCenter: PropTypes.bool, + displayTitle: PropTypes.bool, + displayIntro: PropTypes.bool +} + +const SignupFormWithStyles = withStyles(styles)(SignupForm) + +export default withWidth()(SignupFormWithStyles) diff --git a/client/src/views/email-verification/components/SignupVerifyResponse.js b/client/src/views/email-verification/components/SignupVerifyResponse.js new file mode 100644 index 000000000..a31cbe11b --- /dev/null +++ b/client/src/views/email-verification/components/SignupVerifyResponse.js @@ -0,0 +1,82 @@ +import React from 'react' +import PropTypes from 'prop-types' + +import { BannerTopBar } from '../../common' +import SignupForm from './SignupForm' + +export class SignupVerifyResponse extends React.Component { + componentDidMount () { + const { mutate } = this.props + mutate() + }; + + render () { + const { loading, error, data } = this.props + let BannerTitle = '' + let BannerText = '' + let displayForm = false + console.log('SignupVerifyResponse:', loading, error, data) + if (error) { + if (error.message === 'GraphQL error: Error: Token Expired. Please resubmit email address.') { + BannerText = [ + + Newsletter Signup Error: Verification Token Expired + , +
, + 'Please resubmit your email address and a new token will be emailed to you.', +
, + ' We apologize for the inconvenience, but we highly value your seurity and privacy.' + ] + displayForm = true + } else { + BannerText = ['Newsletter Signup Error: ',
, error.message] + } + return ( + + ) + } + if (loading && !error) { + BannerText = ['Processing newsletter sign-up...',
, 'Thank you for opting-in to recieve updates about the Advanced Algos project!'] + } + if (data !== undefined && data !== null) { + console.log(data) + if (data.master_NewsletterSignupVerify === 'SUCCESS') { + return ( + + + {displayForm && } + + + ) + } + } else { + return ( + + ) + } + } +} + +SignupVerifyResponse.propTypes = { + mutate: PropTypes.function, + loading: PropTypes.bool, + error: PropTypes.object, + data: PropTypes.object +} + +export default SignupVerifyResponse diff --git a/client/src/views/email-verification/components/styles.js b/client/src/views/email-verification/components/styles.js new file mode 100644 index 000000000..5c70b4544 --- /dev/null +++ b/client/src/views/email-verification/components/styles.js @@ -0,0 +1,65 @@ +import lightGreen from '@material-ui/core/colors/lightGreen' + +const styles = theme => ({ + textLight: { + color: theme.palette.primary.light + }, + textWhite: { + color: theme.palette.common.white + }, + textSuccess: { + color: lightGreen[400] + }, + copyright: { + paddingTop: theme.spacing.unit * 3 + }, + linkLight: { + color: theme.palette.secondary.main, + textDecoration: 'none' + }, + signupRight: { + marginTop: theme.spacing.unit * 2, + [theme.breakpoints.down('xs')]: { + textAlign: 'center' + } + }, + signupContainer: { + marginBottom: theme.spacing.unit * 2, + [theme.breakpoints.down('xs')]: { + textAlign: 'center' + } + }, + signupInput: { + borderRadius: 4, + backgroundColor: theme.palette.common.white, + border: '1px solid #ced4da', + fontSize: 16, + padding: '10px 12px', + transition: theme.transitions.create(['border-color', 'box-shadow']), + marginRight: theme.spacing.unit * 1 + }, + signupInputSubmit: { + boxShadow: 'none', + textTransform: 'none', + fontSize: 16, + lineHeight: '1.1875em', + color: theme.palette.common.white, + padding: '10px 12px', + backgroundColor: '#5bc0de', + borderColor: '#46b8da', + '&:hover': { + backgroundColor: '#31b0d5', + borderColor: '#269abc' + }, + '&:active': { + boxShadow: 'none', + backgroundColor: '#0062cc', + borderColor: '#005cbf' + }, + '&:focus': { + boxShadow: '0 0 0 0.2rem rgba(0,123,255,.5)' + } + } +}) + +export default styles diff --git a/client/src/views/email-verification/graphql/NewsletterSignup.js b/client/src/views/email-verification/graphql/NewsletterSignup.js new file mode 100644 index 000000000..314b47bf3 --- /dev/null +++ b/client/src/views/email-verification/graphql/NewsletterSignup.js @@ -0,0 +1,10 @@ +/* eslint-disable no-unused-vars */ +import gql from 'graphql-tag' + +const NEWSLETTER_SIGNUP = gql` + mutation NewsletterSignup($email: String!) { + master_NewsletterSignup(email: $email) + } +` + +export default NEWSLETTER_SIGNUP diff --git a/client/src/views/email-verification/graphql/NewsletterSignupVerify.js b/client/src/views/email-verification/graphql/NewsletterSignupVerify.js new file mode 100644 index 000000000..462a8cd3b --- /dev/null +++ b/client/src/views/email-verification/graphql/NewsletterSignupVerify.js @@ -0,0 +1,10 @@ +/* eslint-disable no-unused-vars */ +import gql from 'graphql-tag' + +const NEWSLETTER_SIGNUP_VERIFY = gql` + mutation NewsletterSignupVerify($token: String!) { + master_NewsletterSignupVerify(token: $token) + } +` + +export default NEWSLETTER_SIGNUP_VERIFY diff --git a/client/src/views/email-verification/index.js b/client/src/views/email-verification/index.js new file mode 100644 index 000000000..8e38064c6 --- /dev/null +++ b/client/src/views/email-verification/index.js @@ -0,0 +1,59 @@ +import React from 'react' +import PropTypes from 'prop-types' +import queryString from 'query-string' +import { Mutation } from 'react-apollo' + +import { BannerTopBar } from '../common' +import SignupVerifyResponse from './components/SignupVerifyResponse' + +import NEWSLETTER_SIGNUP_VERIFY from './graphql/NewsletterSignupVerify' + +export const EmailSignupConfirm = ({ tokenParam }) => { + let token + let BannerText = '' + if (tokenParam !== '' && tokenParam !== null) { + const values = queryString.parse(tokenParam) + token = values.token + } else { + BannerText = [ + 'Newsletter Signup Error: Invalid Token', +
, + 'Please try signing up again! We apologize for the inconvenience,', +
, + 'but we highly value your seurity and privacy.' + ] + return ( + + ) + } + console.log(token) + return ( + + {(NewsletterSignupVerify, { loading, error, data }) => { + return ( + + ) + } + } + + ) +} + +EmailSignupConfirm.propTypes = { + tokenParam: PropTypes.string +} + +export default EmailSignupConfirm diff --git a/client/src/views/home/index.js b/client/src/views/home/index.js index e078c2107..f9473faaa 100644 --- a/client/src/views/home/index.js +++ b/client/src/views/home/index.js @@ -1,5 +1,5 @@ import React, { Component } from 'react' -import BannerTopBar from '../BannerTopBar' +import { BannerTopBar } from '../common' import { Typography } from '@material-ui/core' class Home extends Component { diff --git a/client/src/views/index.js b/client/src/views/index.js index c86a62d96..1d70a9d6c 100644 --- a/client/src/views/index.js +++ b/client/src/views/index.js @@ -2,5 +2,6 @@ import Home from './home' import Charts from './charts' import Callback from './callback' import Layout from './layout' +import EmailSignupConfirm from './email-verification' -export { Layout, Home, Charts, Callback } +export { Layout, Home, Charts, Callback, EmailSignupConfirm } diff --git a/client/src/views/layout/footer/index.js b/client/src/views/layout/footer/index.js index 7be97c6c3..1989fcde2 100644 --- a/client/src/views/layout/footer/index.js +++ b/client/src/views/layout/footer/index.js @@ -9,12 +9,12 @@ import { connect } from 'react-redux' import Typography from '@material-ui/core/Typography' import Grid from '@material-ui/core/Grid' -import Button from '@material-ui/core/Button' -import InputBase from '@material-ui/core/InputBase' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faFacebookF, faTelegramPlane, faTwitter } from '@fortawesome/free-brands-svg-icons' import styles from './styles' +import SignupForm from '../../email-verification/components/SignupForm' + import aalogo from '../../../assets/advanced-algos/aa-logo-horiz-dark.svg' class Footer extends Component { @@ -48,24 +48,7 @@ class Footer extends Component { - - Stay in touch! - Opt-in our mailing list to stay up to date with the Advanced Algos Project. -
- Thank you for your interest! We'll keep you informed - - - - -
-
+ Meet us on Social Networks: diff --git a/client/src/views/layout/header/imports.js b/client/src/views/layout/header/imports.js index badac9507..fb9855a27 100644 --- a/client/src/views/layout/header/imports.js +++ b/client/src/views/layout/header/imports.js @@ -27,7 +27,7 @@ const teamsMenus = { title: 'Teams', to: '/teams', submenus: [ - { title: 'All teams', to: '/teams', icon: Search }, + { title: 'Explore teams', to: '/teams/explore', icon: Search }, { title: 'Your teams', to: '/teams/manage-teams', icon: Group, authenticated: true }, { title: 'Team members', to: '/teams/team-members', icon: People, authenticated: true }, { title: 'Financial beings', to: '/teams/financial-beings', icon: Adb, authenticated: true }, diff --git a/server/src/index.js b/server/src/index.js index 0201a1056..6e57897c1 100644 --- a/server/src/index.js +++ b/server/src/index.js @@ -90,16 +90,6 @@ async function run () { resolvers }) - const defaultQuery = `{ - teams_Teams{ - edges{ - node{ - name - } - } - } -} -` const app = express() app.use('/graphql', @@ -168,13 +158,7 @@ async function run () { settings: { 'editor.theme': 'dark', 'editor.cursorShape': 'line' - }, - tabs: [ - { - endpoint: process.env.GRAPHQL_API_URL, - query: defaultQuery - } - ] + } } }) diff --git a/server/src/resolvers/mutation/sendgrid.js b/server/src/resolvers/mutation/sendgrid.js index af9e318d5..8e199d7a1 100644 --- a/server/src/resolvers/mutation/sendgrid.js +++ b/server/src/resolvers/mutation/sendgrid.js @@ -15,12 +15,10 @@ if (dev){ export default { async master_NewsletterSignup(parent, { email }, ctx, info) { + logger.info('master_NewsletterSignup params email:') + logger.info(email) const token = jwt.sign({ email: email }, API_KEY, { expiresIn: '1d' }) - let origin = 'https://advancedalgos.net' const params = '/email-verification?token=' - if (dev){ - origin = 'http://localhost:4100' - } const headers = { 'Content-Type': 'application/json', @@ -82,7 +80,7 @@ export default { async master_NewsletterSignupVerify(parent, { token }, ctx, info){ let origin = 'https://app.advancedalgos.net' if (dev){ - origin = 'http://localhost:4100' + origin = 'http://localhost:3100' } const headers = { 'Content-Type': 'application/json', @@ -160,10 +158,6 @@ export default { return subscribe }, async master_Contact(parent, { email, subject, message, recaptcha }, ctx, info) { - let origin = 'https://advancedalgos.net' - if (dev){ - origin = 'http://localhost:4000' - } const headers = { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin' : origin,