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

Doc not clear about authProvider return values #5491

Closed
DjebbZ opened this issue Nov 5, 2020 · 2 comments · Fixed by #5493
Closed

Doc not clear about authProvider return values #5491

DjebbZ opened this issue Nov 5, 2020 · 2 comments · Fixed by #5493
Assignees

Comments

@DjebbZ
Copy link
Contributor

DjebbZ commented Nov 5, 2020

Hello,

In https://marmelab.com/react-admin/Authentication.html#the-authprovider, you give the spec of the AuthProvider, specifying that each method should return Promise.resolve(). At first, second and third read, for me and my workmate it meant "the methods should return a Promise". After trying to return Promise.reject("something") many times and reading a bit of the source (for example useLogout and checkAuth), it's clear that the logout method must use Promise.resolve and doesn't support Promise.reject. But checkAuth does support Promise.reject.

It would be nice to clarify what exactly is supposed to be returned from these functions.

@fzaninotto
Copy link
Member

You're right, we can do better!

@DjebbZ
Copy link
Contributor Author

DjebbZ commented Nov 6, 2020

  1. You're super fast!
  2. I've read the whole diff, and the Request/Response/Error format tables are spot on. Exactly the kind of info I was seeking.

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants