Refine/Next/Mantine/Supabase - access to register/forgot password page not allowed
While not logged in, the register/forgot password pages are not accessible. I get the unauthenticated redirect to
login?to=%2Fregister
.
Expected behaviour, visitor should be able to register a new account while not authenticated.
Browser console gives 401 error from supabase.
40 Replies
Hi, I am refine support bot :wave:. I am here to help you with your question. I searched for the answer to your question in the refine documentation and found an answer! 🏆
Answer: The code snippet provided shows how to override the login page to allow login with email. SOURCES: ./docs/advanced-tutorials/data-provider/appwrite.md
Answer: The code snippet provided shows how to override the login page to allow login with email. SOURCES: ./docs/advanced-tutorials/data-provider/appwrite.md
Note: If this is the answer you need, then we are very lucky. If not, please wait for someone from the refine core team or the community to try to help you.
wee-brown•2y ago
Popup message is AuthApiError
other-emerald•2y ago
Hi @Devious, By default, the user will be redirected to /login if the checkAuth method rejects the Promise.
Do you to redirect other page ? if you want, you can use this.
you can read this for more information:
https://refine.dev/docs/tutorial/understanding-authprovider/create-authprovider/#checkauth
wee-brown•2y ago
I just want to go to /register, which I thought would work in default (it did when I tested antd).
other-emerald•2y ago
what was your
authProvider
implementation ? antd shouldn't related to this 🤔wee-brown•2y ago
Default at the moment
oh, that posted badly
other-emerald•2y ago
i handled with prettier. its okay
wee-brown•2y ago
I referred to antd because I ran the create with antd to check if it was mantine specific and it worked.
wee-brown•2y ago
Logs from supabase
![No description](https://cdn.answeroverflow.com/1075387083268571186/Screenshot_2023-02-15_at_12.01.40.png)
other-emerald•2y ago
UI packages do not matter for this. but examples from refine may difference.
you can use this to go register page when authentication not resolved
wee-brown•2y ago
Will that not always redirect to register though?
other-emerald•2y ago
yes it will
wee-brown•2y ago
So i would think expected behaviour would be as follows:
no session -> login
click register on login page -> /register
click forgot-password on login page -> /forgot-password
other-emerald•2y ago
Sorry, I couldn't follow exactly.
What was the problem in implementing this business logic?
wee-brown•2y ago
The links on the login page do not redirect to /register when there is no session active