Unhandled Error in logout: refine always expects a resolved promise.
migrated from v3 to v4. logout in AuthProvider error
6 Replies
Hi @ganuzaz. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
In refine v4, the
logout
method in the authProvider
has been updated. You need to make sure that the promise is resolved in all cases with a return type of AuthActionResponse
. When resolving the promise, you must always include a success
key, and in the case of a failure, an additional error
key.
Here's the updated logout
method for refine v4:
And the AuthActionResponse
type:
If you still encounter an error, please make sure you have followed the migration guide correctly: Auth Provider Migration Guide (https://refine.dev/docs/migration-guide/auth-provider/)
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------<@149140198213550080> kapa.ai is still learning and improving, please let us how it did by reacting below
wise-whiteOP•2y ago
same code but still throwing the same error (refine always expect a resolved promise) @kapa.ai
@kapa.ai yes, its the same xcode but its still throwing the same error : refine always expect a resolved promise
Let me check the knowledge base for you. One moment! :books:
----------------------
I apologize for the confusion earlier. Based on the information provided in the extracts, it seems that refine v4 always expects a resolved promise for the
authProvider
methods. If you're still encountering an error, please ensure that your authProvider
methods are returning a resolved promise with the appropriate success
key.
Here's an example of a properly formatted logout
method:
If you're still experiencing issues, it might be helpful to review the refine v4 Auth Provider Migration Guide (https://refine.dev/docs/migration-guide/auth-provider/) and the authProvider documentation (https://refine.dev/docs/api-reference/core/providers/auth-provider) to ensure that your implementation is correct.
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------<@149140198213550080> kapa.ai is still learning and improving, please let us how it did by reacting below
wise-whiteOP•2y ago
changed the parameters into params instead of {email,password}. if anybody is wondering