-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Module parse failed: Unexpected token When adding auth-passport package and creating strategy #2581
Comments
I have the same error caused by importing and using byTracking.
|
…upport status. Further details are explained in this issue: keystonejs#2581
Hey guys, so after spending some time on this one, I've found that google auth is not supported yet. I've sent a pull request to update the documentation but for further details, please read on.
The AdminUIApp constructor needs to be initialized with
Unfortunately, this doesn't really help as the app will just throw an error
because PassportAuthStrategy has the following authType from
|
Yeah those docs could definitely use some improvement. The errors too could be a lot more helpful. However, it's more accurate to say that only password auth is currently supported in the admin UI. Other auth strategies still work when using the GraphQL endpoint. Case in point -- we've been using Google auth (and twitter) on a KS project in production for the last 6 months or so. It lets users sign up to the website, etc. A small number of admins (who need access to the Admin UI) have passwords. Some Keystone projects don't require the Admin UI at all. |
I tried using Google auth on the graphql endpoint: I see that authStrategy option is not even supported for the GraphQLApp() so I tried to run some custom middleware and so far it was working but it's still giving me the issue above when accessing the admin dashboard via password. Can you please share a basic overview of how you set that KS project up @molomby ? |
@molomby Isn't it kind of odd that passport auth is not supported by AdminUIApp, but it is supported by GraphQLApp, when auth strategy is an option only given to AdminUIApp (not GraphQLApp)? const apps = [
new GraphQLApp(),
new AdminUIApp({ authStrategy: passportAuthStrategy }),
]; Probably "auth strategies" should have been independent "apps" to compose with your graphql app, admin ui app, etc. I would actually be super excited to collaborate and work on these new apps ( |
Regardless of that.. After some playing around, I found that it wouldn't take much effort at all to make AdminUIApp work with passport auth! I am working on a PR now, and I hope that @molomby can review and merge! (?) 😃 It would be fantastic to have seamless support for both social signin (passport auth) & admin UI! |
Bug report
Describe the bug
A clear and concise description of the bug.
To Reproduce
Steps to reproduce the behaviour. Please provide code snippets or a repository:
The same Error appears for a multitude of files
System information
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: