Skip to content

Fix Admin Authentication Support #788

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

Merged
merged 3 commits into from
Apr 14, 2019

Conversation

jordanaubert
Copy link
Contributor

Related issue : api-platform/admin#165

ATM, using the latest version of the admin with the current documentation lead to this error when there is no token in the local storage :

Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

    in Switch (created by RoutesWithLayout)
    in RoutesWithLayout (created by Route)
    in div (created by Layout)
    in main (created by Layout)
    in div (created by Layout)
    in div (created by Layout)
    in Layout (created by WithStyles(Layout))
    in WithStyles(Layout) (created by Route)
    in Route (created by withRouter(WithStyles(Layout)))
    in withRouter(WithStyles(Layout)) (created by Connect(withRouter(WithStyles(Layout))))
    in Connect(withRouter(WithStyles(Layout))) (created by LayoutWithTheme)
    in MuiThemeProvider (created by LayoutWithTheme)
    in LayoutWithTheme (created by Route)
    in Route (created by CoreAdminRouter)
    in Switch (created by CoreAdminRouter)
    in div (created by CoreAdminRouter)
    in CoreAdminRouter (created by Connect(CoreAdminRouter))
    in Connect(CoreAdminRouter) (created by getContext(Connect(CoreAdminRouter)))
    in getContext(Connect(CoreAdminRouter)) (created by Route)
    in Route (created by CoreAdminBase)
    in Switch (created by CoreAdminBase)
    in Router (created by ConnectedRouter)
    in ConnectedRouter (created by CoreAdminBase)
    in TranslationProviderView (created by Connect(TranslationProviderView))
    in Connect(TranslationProviderView) (created by CoreAdminBase)
    in Provider (created by CoreAdminBase)
    in CoreAdminBase (created by withContext(CoreAdminBase))
    in withContext(CoreAdminBase) (created by AdminBuilder)
    in AdminBuilder (created by _default)
    in _default (at App.js:39)
    in App (at src/index.js:7)

<HydraAdmin
apiDocumentationParser={apiDocumentationParser}
authProvider={authProvider}
entrypoint={entrypoint}
entrypoint="https://demo.api-platform.com" // Change this by your own entrypoint
Copy link
Member

Choose a reason for hiding this comment

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

I would keep the variable.

Copy link
Contributor Author

@jordanaubert jordanaubert Apr 14, 2019

Choose a reason for hiding this comment

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

I did so because my linter said it shadowed the entrypoint prop of apiDocumentationParser

@alanpoulain alanpoulain merged commit 0ffd027 into api-platform:2.4 Apr 14, 2019
@alanpoulain
Copy link
Member

Thank you @jordanaubert!

@jordanaubert jordanaubert deleted the fix/admin_auth_support branch April 16, 2019 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants