Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Commit eca0269

Browse files
authored
Merge pull request #1400 from withspectrum/splash-page-v2
Splash page marketing update
2 parents 0d0c0c3 + e417612 commit eca0269

File tree

43 files changed

+2348
-1171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2348
-1171
lines changed

iris/index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ const PORT = 3001;
2525
initPassport();
2626
// API server
2727
const app = express();
28-
// $FlowFixMe
29-
if (IS_PROD) {
30-
require('newrelic');
31-
}
3228

3329
import middlewares from './routes/middlewares';
3430
app.use(middlewares);

iris/newrelic.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

iris/routes/auth/logout.js

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
11
// @flow
22
import { Router } from 'express';
3+
const debug = require('debug')('iris:routes:auth:logout');
34
import { destroySession } from '../../models/session';
45

56
const IS_PROD = process.env.NODE_ENV === 'production';
67
const HOME = IS_PROD ? '/' : 'http://localhost:3000/';
78
const logoutRouter = Router();
89

910
logoutRouter.get('/', (req, res) => {
11+
debug('started');
1012
const sessionCookie = req.cookies['connect.sid'];
1113
if (req.isUnauthenticated() || !sessionCookie) {
14+
debug('is unauthenticated, aborting logout');
1215
return res.redirect(HOME);
1316
}
14-
const sessionId = sessionCookie.split('.')[0].replace('s:', '');
15-
return destroySession(sessionId)
16-
.then(() => {
17-
// I should not have to do this manually
18-
// but it doesn't work otherwise ¯\_(ツ)_/¯
19-
res.clearCookie('connect.sid');
20-
req.logout();
21-
res.redirect(HOME);
22-
})
23-
.catch(err => {
24-
res.clearCookie('connect.sid');
25-
console.log(err);
26-
res.redirect(HOME);
27-
});
17+
debug('logging out');
18+
req.logout();
19+
req.session.destroy(err => {
20+
if (err) console.log(err);
21+
debug(`destroyed session, redirecting`);
22+
res.redirect(HOME);
23+
});
2824
});
2925

3026
export default logoutRouter;

iris/routes/middlewares/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import { Router } from 'express';
33

44
const middlewares = Router();
55

6+
if (process.env.NODE_ENV === 'development') {
7+
const logging = require('./logging');
8+
middlewares.use(logging);
9+
}
10+
611
if (process.env.NODE_ENV === 'production' && !process.env.FORCE_DEV) {
712
// Raven (Sentry client) needs to come before everything else
813
const raven = require('./raven').default;

iris/routes/middlewares/logging.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// @flow
2+
// Log requests with debug
3+
const debug = require('debug')('iris:web');
4+
5+
module.exports = (req: Request, res: Response, next: Function) => {
6+
debug(`requesting ${req.url}`);
7+
next();
8+
};

iris/routes/middlewares/session.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default session({
1414
// Forces a session that is "uninitialized" to be saved to the store
1515
// NOTE(@mxstbr): This might not be necessary or even useful, but the default example of
1616
// session-rethinkdb uses it. Ref: llambda/session-rethinkdb#12
17-
saveUninitialized: true,
17+
saveUninitialized: false,
1818
// Force a session identifier cookie to be set on every response, resets the expire date of the
1919
// cookie to one year from the time of the response, meaning you'll only get logged out after a
2020
// year of inactivity.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"flow-bin": "^0.43.0",
99
"lint-staged": "^3.3.0",
1010
"micromatch": "^3.0.4",
11+
"newrelic": "^2.2.0",
1112
"nodemon": "^1.11.0",
1213
"prettier": "^1.0.0",
1314
"raw-loader": "^0.5.1",

public/img/conversation.svg

Lines changed: 162 additions & 0 deletions
Loading

public/img/discover.png

347 KB
Loading

public/img/goopy-2.svg

Lines changed: 0 additions & 37 deletions
This file was deleted.

public/img/goopy-3.svg

Lines changed: 0 additions & 21 deletions
This file was deleted.

public/img/goopy-4.svg

Lines changed: 0 additions & 17 deletions
This file was deleted.

public/img/goopy.svg

Lines changed: 0 additions & 52 deletions
This file was deleted.

src/actions/authentication.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { clearApolloStore } from '../api';
44
import { removeItemFromStorage, storeItem } from '../helpers/localStorage';
55
import Raven from 'raven-js';
66

7-
export const logout = () => {
7+
export const logout = dispatch => {
88
track(`user`, `sign out`, null);
99
// clear localStorage
1010
removeItemFromStorage('spectrum');
@@ -15,6 +15,10 @@ export const logout = () => {
1515
process.env.NODE_ENV === 'production'
1616
? '/auth/logout'
1717
: 'http://localhost:3001/auth/logout';
18+
19+
dispatch({
20+
type: 'CLEAR_USER',
21+
});
1822
};
1923

2024
export const saveUserDataToLocalStorage = (user: Object) => dispatch => {

src/api/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ export const SERVER_URL =
101101
? `${window.location.protocol}//${window.location.host}`
102102
: 'http://localhost:3001';
103103

104+
export const CLIENT_URL =
105+
process.env.NODE_ENV === 'production'
106+
? `${window.location.protocol}//${window.location.host}`
107+
: 'http://localhost:3000';
108+
104109
export const PUBLIC_STRIPE_KEY =
105110
process.env.NODE_ENV === 'production'
106111
? 'pk_live_viV7X5XXD1sw8aN2NgQjiff6'

src/components/buttons/style.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const baseButton = css`
2020
line-height: 1;
2121
position: relative;
2222
text-align: center;
23-
padding: ${props => (props.icon ? '4px 8px 4px 4px' : '12px 16px')};
23+
padding: ${props => (props.icon ? '4px 8px' : '12px 16px')};
2424
2525
&:hover {
2626
transition: ${Transition.hover.on};

src/components/fullscreenView/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
ClusterTwo,
66
ClusterThree,
77
ClusterFour,
8-
} from '../../views/homepage/style';
8+
} from '../../views/splash/components/illustrations';
99
import Icon from '../../components/icons';
1010
import { FullscreenViewContainer, Illustrations, Close } from './style';
1111

0 commit comments

Comments
 (0)