Skip to content
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

Login the first time redirect to React-admin welcome page #511

Open
adguernier opened this issue Nov 2, 2023 · 0 comments
Open

Login the first time redirect to React-admin welcome page #511

adguernier opened this issue Nov 2, 2023 · 0 comments

Comments

@adguernier
Copy link
Contributor

API Platform version(s) affected: 3.2.2
@api-platform/admin: 3.4.4

Description
My context: I have a JWT protected API, and a protected Hydra-admin with a custom authProvider and the requireAuth set to true.

<HydraAdmin
      requireAuth
      entrypoint={window.origin}
      dataProvider={dataProvider}
      authProvider={authProvider}
/>

The first time I go to my admin app (https://localhost/admin), I'm redirected to the login page (https://localhost/admin#/login). No problem here.
I log in and I'm redirected to the welcome React-admin page instead of the resources view.

How to reproduce
You can clone this repository https://github.com/adguernier/api-platform-auth-provider and follow the README.md

Possible Solution
It seems the adminDataProvider introspect() method does not check the authProvider checkAuth() method.

Additional Context
The first time the login page is render, an error occurred in the console:
image

The dataProvider I've written uses the Bearer token as described in your example

An example is worth a thousand words

Capture.video2.2023-11-02.11.32.47.mp4
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

No branches or pull requests

1 participant