decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.81k stars 3.04k forks source link

Add instructions for auth with Netlify Identity and Git Gateway #600

Closed verythorough closed 6 years ago

verythorough commented 7 years ago

In the current docs outline, this requires changes in a few places:

/docs/intro.md

/docs/test-drive.md (see PR #626)

/docs/quick-start.md

/docs/custom-authentication.md (see PR #751)

I think that covers everything for now (until we restructure the docs as described in #598). Feel free to add anything I'm missing.

eamonnbell commented 7 years ago

I'd be very happy to help on this, on an ongoing basis, having spent some time this morning trying to get my head around the dependencies between GitHub, the SPA and api.netlify.com.

In particular, I think we can make the docs more explicit about the need for and the nature of any dependencies on Netlify-owned servers (i.e. api.netlify.com for the github backend).

As a concrete example, in the new Authentication section, we should make it clear that when used in a local dev environment, netlify-cms will identify itself as cms.netlify.com to the Netlify auth service.

My sense is as the git-gateway documentation is developed, then the language to describe the Netlify auth ("Authentication Provider") for the github backend will firm up

verythorough commented 7 years ago

Thanks, @eamonnbell! In the interest of getting the simplest parts working before tackling the more involved ones, I'm planning to put up a PR for the test-drive changes today. Then I'll do one for quick-start, probably tomorrow. When those are done and people can see a clearer view of how the git-gateway backend works, we can talk about how to structure the new Authentication page.

Let me know if you'd like to jump in on any of these before I get started (in a few hours).

eamonnbell commented 6 years ago

Sorry for my late reply, I hope I didn't hold up anything. If you haven't started, I could jump in on the "test-drive" changes and have a PR for you to have a look at by tomorrow AM. Or, just @ me when the Authentication page is ready for discussion and we can go from there.

verythorough commented 6 years ago

@eamonnbell no problem! PR #626 referenced above ^ has my update to the Test Drive doc. I'd love it if you could take a look. I'm thinking I'll start next on the Quick Start, but it occurs to me that if it gets published before the Custom Authentication page gets updated, there won't be any docs for the github backend anymore, so I guess both pages will have to be updated together.

verythorough commented 6 years ago

As we re-structure the docs as outlined in #598, I'm using the remaining check points of this issue to track improvements to the authentication and backends documentation. Here's the general page outline from #598:

Backends & authentication

I've called for full instructions for Netlify-enabled backends, and external links for more DIY options, but if there are contributors who would like to write full instructions for those, we can do that.

DirtyF commented 6 years ago

I just followed the documentation and it works great, except for the redirect from the index page, instead a modal is displayed to confirm I'm logged in:

netlify-identity

Note: as there's a redirection to latest package version you could simply write <link rel="stylesheet" href="https://unpkg.com/netlify-cms/dist/cms.js" /> in the documentation.

AustinGreen commented 6 years ago

@DirtyF I'm having trouble getting this working as well. Seems like the init event is never firing. Did you find a solution?

DirtyF commented 6 years ago

@AustinGreen nope, functions still return undefined:

  if (window.netlifyIdentity) {
    window.netlifyIdentity.on("init", user => {
      if (!user) {
        window.netlifyIdentity.on("login", () => {
          document.location.href = "/admin/";
        });
      }
    });
  }
undefined
window.netlifyIdentity
Object { on: on(), open: open(), close: close(), currentUser: currentUser(), logout: logout(), gotrue: Getter, init: init() }
window.netlifyIdentity.on("init", user => {})
undefined
window.netlifyIdentity.on("login", () => {})
undefined
erquhart commented 6 years ago

@DirtyF source issue here: https://github.com/netlify/netlify-identity-widget/issues/86

erquhart commented 6 years ago

Auth issues should be addressed as of 0.7.6.

verythorough commented 6 years ago

751 Finished this out.