diff --git a/frontend/menus/AccountMenu.js b/frontend/menus/AccountMenu.js
index 77ca6cb2d..4a701da9b 100644
--- a/frontend/menus/AccountMenu.js
+++ b/frontend/menus/AccountMenu.js
@@ -24,7 +24,7 @@ import { DropdownMenu, DropdownMenuItem } from 'components/DropdownMenu';
handleLogout = () => {
this.props.auth.logout();
- this.props.history.push('/');
+ window.location.href = BASE_URL;
};
render() {
diff --git a/frontend/scenes/SlackAuth/SlackAuth.js b/frontend/scenes/SlackAuth/SlackAuth.js
index 2846b75ad..87a0ff7f1 100644
--- a/frontend/scenes/SlackAuth/SlackAuth.js
+++ b/frontend/scenes/SlackAuth/SlackAuth.js
@@ -5,6 +5,7 @@ import queryString from 'query-string';
import { observable } from 'mobx';
import { observer, inject } from 'mobx-react';
import { client } from 'utils/ApiClient';
+import { slackAuth } from 'utils/routeHelpers';
import AuthStore from 'stores/AuthStore';
@@ -33,7 +34,7 @@ type Props = {
} else {
this.redirectTo = '/auth/error';
}
- } else {
+ } else if (code) {
if (this.props.location.pathname === '/auth/slack/commands') {
// User adding webhook integrations
try {
@@ -43,7 +44,7 @@ type Props = {
this.redirectTo = '/auth/error';
}
} else {
- // Regular Slack authentication
+ // Slack authentication
const redirectTo = sessionStorage.getItem('redirectTo');
sessionStorage.removeItem('redirectTo');
@@ -52,6 +53,9 @@ type Props = {
? (this.redirectTo = redirectTo || '/dashboard')
: (this.redirectTo = '/auth/error');
}
+ } else {
+ // Sign In
+ window.location.href = slackAuth(this.props.auth.getOauthState());
}
}
diff --git a/frontend/stores/AuthStore.js b/frontend/stores/AuthStore.js
index 99c8305bd..d165de33c 100644
--- a/frontend/stores/AuthStore.js
+++ b/frontend/stores/AuthStore.js
@@ -34,7 +34,7 @@ class AuthStore {
@action logout = () => {
this.user = null;
this.token = null;
- Cookie.remove('loggedId', { path: '/' });
+ Cookie.remove('loggedIn', { path: '/' });
};
@action getOauthState = () => {
diff --git a/frontend/utils/routeHelpers.js b/frontend/utils/routeHelpers.js
index 4db4200f7..b1e5f16ab 100644
--- a/frontend/utils/routeHelpers.js
+++ b/frontend/utils/routeHelpers.js
@@ -22,6 +22,31 @@ export function documentUrl(doc: Document): string {
return doc.url;
}
+export function slackAuth(
+ state: string,
+ scopes: string[] = [
+ 'identity.email',
+ 'identity.basic',
+ 'identity.avatar',
+ 'identity.team',
+ ],
+ redirectUri: string = `${BASE_URL}/auth/slack`
+): string {
+ const baseUrl = 'https://slack.com/oauth/authorize';
+ const params = {
+ client_id: SLACK_KEY,
+ scope: scopes ? scopes.join(' ') : '',
+ redirect_uri: redirectUri,
+ state,
+ };
+
+ const urlParams = Object.keys(params)
+ .map(key => `${key}=${encodeURIComponent(params[key])}`)
+ .join('&');
+
+ return `${baseUrl}?${urlParams}`;
+}
+
export function documentNewUrl(doc: Document): string {
const newUrl = `${doc.collection.url}/new`;
if (doc.parentDocumentId) {
diff --git a/server/pages/About.js b/server/pages/About.js
index 5d7c43d24..281ff9197 100644
--- a/server/pages/About.js
+++ b/server/pages/About.js
@@ -1,14 +1,8 @@
// @flow
import React from 'react';
-import styled from 'styled-components';
import Grid from 'styled-components-grid';
import { Helmet } from 'react-helmet';
-
-const Header = styled.div`
- width: 100%;
- padding: 3em;
- text-align: center;
-`;
+import Hero from './components/Hero';
export default function About() {
return (
@@ -16,12 +10,12 @@ export default function About() {
Just a proof of concept for multiple pages.
Documentation, meeting notes, playbooks, onboarding, work logs, brainstorming, decisions, & more…
Documents are stored in Markdown and you can export them at any time. Markdown shortcuts are also built right into the editor so you can easily format using markdown syntax or our GUI.
Built-in search makes that one document easy to find in a large knowledgebase.
- Atlas is built on it’s own API, treat Atlas as a CMS or automatically great documents from outside events.
+ Atlas is built on it’s own API, treat Atlas as a CMS or automatically create documents from outside events.
- Want to contribute or host Atlas yourself? All of the code is on GitHub.
+ Want to contribute or host Atlas yourself? All of the code is available on GitHub.
- Just a proof of concept for multiple pages.
+ Explore Atlas with a 14 day trial, free forever for teams smaller than 5.
About Atlas
Your team’s knowledge base
Blazing Fast
@@ -39,30 +38,30 @@ export default function Home() {
Markdown Support
+ Beautiful Editor
Powerful Search
API & Integrations
Open Source
Pricing