johnwards
Explore posts from serversRRefine
•Created by rival-black on 4/5/2023 in #ask-any-question
Error: A component is changing an uncontrolled input to be controlled.
Good work @kapa.ai
9 replies
RRefine
•Created by fascinating-indigo on 4/5/2023 in #ask-any-question
Error: A component is changing an uncontrolled input to be controlled.
Awesome!
defaultValue={false} fixed it..
9 replies
RRefine
•Created by xenial-black on 4/3/2023 in #ask-any-question
onSettled error when creating a child item
Hmm so playing around a bit more after reading https://tanstack.com/query/v4/docs/react/guides/mutations#consecutive-mutations
I created an artwork mutate like this and used it:
Is this valid? Am I doing bad things/hacks??
6 replies
Hello is there any guide to using a
It's not really a tool issue. You need your backend to set the refresh token as a http only cookie, store your auth token in a global in memory variable.
Then call your refresh end point when your auth token expires, which should read your http cookie, return a new auth token, you replace the in memory one
16 replies
Hello is there any guide to using a
Ah that is super interesting, thanks!
But why do you need a library etc to handle the global state for a bit of data that you are likely only going to need to set in one place? Global variables aren't that bad if handled correctly also 🙂
16 replies
Hello is there any guide to using a
Yeah I'm just dropping token into local storage, like the examples here https://refine.dev/docs/tutorial/understanding-authprovider/create-authprovider/#setting-authorization-credentials
16 replies
RRefine
•Created by generous-apricot on 3/15/2023 in #ask-any-question
Invalidate login when API authentication expires?
It's hacky, I'd rather redraw so I can pass a message. But it will do for now.
Any bright ideas about how to do this without reloading very welcome
8 replies
RRefine
•Created by crude-lavender on 3/15/2023 in #ask-any-question
Invalidate login when API authentication expires?
Ah!
Simply intercepting the error, deleting the local storage and then doing a
window.location.reload();
will do nicely
8 replies
RRefine
•Created by future-harlequin on 3/15/2023 in #ask-any-question
Invalidate login when API authentication expires?
@kapa.ai I don't think you can use useLogout in an axios interceptor. That looks to be breaking rules of hooks.
8 replies