Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New login screen #1331

Merged
merged 15 commits into from
Jul 10, 2020
Merged

New login screen #1331

merged 15 commits into from
Jul 10, 2020

Conversation

tommoor
Copy link
Member

@tommoor tommoor commented Jul 2, 2020

Removes the final pieces of marketing page content from this repo (If you're interested, they'll be served from a separate server/repo here: https://github.com/outline/website). In doing so we'll rebuild the login screen to actually look like… well, a login screen.

This means a big code size reduction, reduce complexity of the server, reduced complexity of the signin flow, and a clearer separation of concerns between marketing/app. It was also an opportunity to fix the issue with email signin not being available in self-hosted installations.

TODO

  • Move login page to being rendered by app
  • Treat app. subdomain as if it's root
  • Add API endpoint to load auth options
  • Build a new login screen (design needed)
  • Variation needed for teams with guest signin
  • Variation needed on language for account creation (query param?)
  • Remove all leftover server-rendered pages
    image

Screenshots

Subdomain signin (with guest signin enabled)

image

image

image

Root signin (dark mode)

image

image

Self hosted

image

closes #1316
closes #1203
closes #1121
closes #1106
related #862

@tommoor tommoor marked this pull request as ready for review July 4, 2020 04:41
@@ -126,7 +126,6 @@ Backend is driven by [Koa](http://koajs.com/) (API, web server), [Sequelize](htt
- `server/commands` - Domain logic, currently being refactored from /models
- `server/emails` - React rendered email templates
- `server/models` - Database models
- `server/pages` - Server-side rendered public pages
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No more server-rendered marketing pages 👏

@@ -1,36 +0,0 @@
// @flow
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Found during cleanup, not used.

@@ -35,7 +36,7 @@ const Authenticated = observer(({ auth, children }: Props) => {
}

auth.logout(true);
return null;
return <Redirect to="/" />;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍖 Previously we relied on auth.logout() to reload the page, at which point the server would see there is no accessToken cookie and render the homepage. Now, we can just send the user to the login screen directly as it's rendered by the same React app.

@@ -1,7 +1,7 @@
// @flow
import styled from "styled-components";
import breakpoint from "styled-components-breakpoint";
import Flex from "shared/components/Flex";
import Flex from "components/Flex";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no more shared React components, so moved everything across to the main components directory.

// @flow
import styled from "styled-components";

const Notice = styled.p`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually moved from shared and just updated a little.

return output;
}

router.post("auth.config", async ctx => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍖 New unauthorized API endpoint returns signin options, depending on subdomain / root / self hosted.

@@ -122,12 +43,17 @@ router.get("/opensearch.xml", ctx => {
ctx.body = opensearchResponse();
});

// catch all for react app
// catch all for application
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍖 so much simpler now we don't have to detect cookies or render static pages.

if (
!parsed ||
!parsed.subdomain ||
parsed.subdomain === "app" ||
Copy link
Member Author

@tommoor tommoor Jul 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍖 Do not consider app. to be a team subdomain, it will be used for the root login and www. will be used for marketing site. This should not affect self hosted installations as they do not have multiple subdomains.

'process.env': {
DEPLOYMENT: JSON.stringify(process.env.DEPLOYMENT),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍖 This was a mistake, it should have been here before

URL: JSON.stringify(process.env.URL),
TEAM_LOGO: JSON.stringify(process.env.TEAM_LOGO),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍖 This is new, TEAM_LOGO value was not previously accessed by the client

@tommoor tommoor added the open for feedback This PR is open for feedback on the approach label Jul 8, 2020
@tommoor tommoor merged commit 5cb04d7 into develop Jul 10, 2020
@delete-merged-branch delete-merged-branch bot deleted the feat/issue-1316 branch July 10, 2020 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open for feedback This PR is open for feedback on the approach
Projects
None yet
1 participant