How to support 2 login methods: email and github OAuth at once? #4836
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hey @liushooter, you can easily support multiple auth methods with refine. By looking at your code, I can see couple of misunderstandings, let me try to help you fix them 🚀 The methods in the You may also need to use |
Beta Was this translation helpful? Give feedback.

Hey @liushooter, you can easily support multiple auth methods with refine. By looking at your code, I can see couple of misunderstandings, let me try to help you fix them 🚀
The methods in the
authProviderare called by<Refine>but React hooks cannot be used inside them. You can just do thefetchcall instead of using it insideuseEffect. Same thing also applies foruseNavigateanduseLocationhooks, instead of using these hooks, you can use thewindow.location, you can uselocation.openorlocation.hreffor navigation andlocation.searchfor getting the URL params.You may also need to use
awaitinstead ofthenfor the api request. 🚀