Skip to content
This repository has been archived by the owner on Sep 13, 2019. It is now read-only.

Closed loop update to make goggles use id.wmo and publish.wmo #202

Closed
wants to merge 5 commits into from
Closed

Conversation

Pomax
Copy link
Contributor

@Pomax Pomax commented Sep 12, 2015

This is going to need some UX design done in order to get the user flow to feel right. The login concept itself is similar to what discourse.webmaker.org does. Because users cannot be redirected from the page they're working on without losing all their work, attempting to login when you want to publish (the publish dialog is an iframe with a goggles-hosted content) spawns a new window/tab to id.webmaker.org, which users run through in order to become authenticated. The last step in the authentication process redirects them to a login status page running on the same goggles domain as the publish dialog, and sets the login token as a persistent value (using localStorage rather than a cookie). When the publish dialog sees this token existing, it queries id.webmaker.org for the user information associated with the auth token, and can change its UI to give the user the ability to publish their content via the goggles publish route.

Note: this PR only covers the id.wmo oauth2 login, and does not cover publishing or surfacing publishing UI once the user is authenticated.

// oauth login confirmation page
app.get("/login-confirmation.html", csp, function(req, res) {
res.render("login-confirmation.html", {
audience: env.get("audience"),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these options can probably go, since id.wmo is restful

@Pomax Pomax changed the title initial id.wmo interfacing. Terrible UX, but closed loop [WIP] initial id.wmo interfacing. Terrible UX, but closed loop Sep 12, 2015
document.addEventListener("focus", function() {
if (!checked) {
checked = true;
var authToken = localStorage["goggles-auth-token"];
Copy link

Choose a reason for hiding this comment

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

.getItem() or am I missing some wrapper lib?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually native JS API: both localStorage["key"] and localStorage.getItem("key") do the same thing (for removals, though, you want removeItem rather than the more base JS delete)

@Pomax Pomax changed the title [WIP] initial id.wmo interfacing. Terrible UX, but closed loop Closed loop update to make goggles use id.wmo and publish.wmo Sep 29, 2015
@Pomax
Copy link
Contributor Author

Pomax commented Sep 29, 2015

closing, to merge into develop instead.

@Pomax Pomax closed this Sep 29, 2015
@Pomax Pomax deleted the idwmo branch September 29, 2015 19:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants