-
Notifications
You must be signed in to change notification settings - Fork 986
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
Admin login not working? #3
Comments
Thanks for the catch, my latest commit should fix it. Let me know if it's still not working. |
Actually, I can't seem to get the redirect to the admin after logging in to work. The init event never fires. Looks like this is a known issue. Were you able to get it working? |
It works here. |
Yes it's working there, do you mind sharing where you included this in your gatsby project:
|
I've added it to the generated index.html by hand, just to check if this will work. I'm gatsby newbie, so I dont' know yet how to configure gatsby to do it. |
I'm also React newbie, but I've managed to find this ugly solution [1] [2]:
[1] https://www.gatsbyjs.org/docs/custom-html/ |
I was hoping to find another solution because editing the |
I see. |
Another ugly hack, I've moved that inline-before-body script to |
@AustinGreen source issue here: netlify/netlify-identity-widget#86 |
I have worked it out. I think that the issue is that you need to deploy the app again after you have finished activating the Identity service, I did just a simple text change and publish. Refresh and it works. |
I seem to be having an issue with netlify identity as well. When I go to /admin and login, I get redirected to the home page with a json token in the URL. I tried to login again, and keep returning to the home page with the token. It turns out that the
script is not actually running. An async callback does the trick, making sure the CDN netlify identity script runs before adding this on init function. netlifyIdentity also needs to be manually initialized with Side note: I got the CMS to work locally as well, by passing in the name "test-repo" in config.yml, which lets you use the browsers' local storage to test whether your configuration is bug free. This will not let you actually publish to your github repo, so its really just for testing config. Question: Austin, since you have both index.html and config.ym is static/admin, did you have to customize Gatsby's webpack config to route to admin? it seems to only work in production. I took you boilerplate and added in the admin page as a widget. Any reason you didn't go that route? |
@luczaki114 Great, I'll give this a try, or feel free to submit a PR! I've tried both options, and I like having the admin in the static directory. You can still test locally on |
I was able to test locally on 9000, but netlify notices that, asks me to link my site URL, and then redirects me to that sites admin page, which is not what i want. I would love to be able to play with the config file on local without a redirect. Are you experiencing that? |
No, I'm able to access the admin locally. Try going to |
I believe this issue can be closed after that last merge. |
Thanks for the PR @luczaki114 |
I published the site (without any modification after creating) on Netlify (just by dropping the public folder), and enabled the Identity service (with gitlab provider). After logging in with Gitlab account I'm redirected to main site page (with OAuth access_token) but it didn't redirect me back to admin interface.
I had to add
in
<head>
and
before
<body>
end in main site index.html just as the documentation says. Shouldn't you make gatsby add it automatically to public/index.html?Nonetheless, admin interface now loads, but I fail to see any content that is already present on the site. But maybe it's because the site was not created from Git.
The text was updated successfully, but these errors were encountered: