404 after logging in
Why does refine application show a 404 after signing in? I have a custom auth provider(keycloak.js) and this started happening after I injected it into refine application. As a framework I thought refine should not care what that auth provider does, whenever you hit a route like on screenshot refine should take control and redirect you if you're logged in. And it actually happened before when there was no keycloak auth provider. But now this happens. Also, as a matter of fact, I have a custom catchAll page(basically the one you see on screenshot) and it's code will be below. Should this behaviour somehow be moderated in catchAll component?
62 Replies
rival-blackβ’2y ago
The code for catchall component:
Hey @metammodern ,
This is not expected behavior. Can you share your AuthProvider?
rival-blackβ’2y ago
Sure, here is authProvider:
(if you know how to fold code blocks on discord let me know)
And here is UserService.ts
My guess is that Keycloak is running as async so when run checkAuth it returns Promise.reject for first load.
To avoid a similar situation in our Auth0 example, we wait for Auth0 to be init, https://github.com/refinedev/refine/blob/next/examples/auth-auth0/src/App.tsx#L23
Hey @_rassie ,
I hope you are very well. Maybe you can help us with this π
rival-blackβ’2y ago
@Omer I can log and check)
rival-blackβ’2y ago
@Omer I did it like this. The logs are the ones that ran only after redirect back from keycloak
How can we reproduce this issue?
Also you can review Auth0 and Google Auth examples
https://refine.dev/docs/advanced-tutorials/auth/auth0/
https://refine.dev/docs/examples/auth-provider/google-auth/
Auth0 Login | refine
Auth0 is a flexible, drop-in solution for adding authentication and authorization services to your applications. Your team and organization can avoid the cost, time, and risk that comes with building your own solution to authenticate and authorize users. You can check the Auth0 document for details.
Google Auth | refine
You can use Google Login to control access and provide identity for your app. This example will guide you through how to connect Google Login into your project using refine.
rival-blackβ’2y ago
Hm, I guess I'll have to create a stackblitz for that, that should not be anyhow related to keycloak...
Hey @dontpanicaim ,
I hope you are very well. Maybe you can help us with this π
conventional-tanβ’2y ago
does the 404 go away with a manual page reload?
rival-blackβ’2y ago
@dontpanicaim hi, no it doesn't
conventional-tanβ’2y ago
@Omer thanks! im doing well! hope you are being awesome as normally too π
Glad to see you! Are you planning to join the hackathon? β‘οΈ
conventional-tanβ’2y ago
ooh is there a hackathon?
@metammodern hmm everything looks pretty good, do you know if
getUserIdentity
is being called?
I've been thinking of replace supabase with Hasura in the project I was working on