# Supabase Password Reset Flow Not Redirecting to Reset Password Page

**URL:** <https://community.weweb.io/t/supabase-password-reset-flow-not-redirecting-to-reset-password-page/14995>\
**Category:** Ask us anything\
**Tags:** authentication, supabase\
**Created:** [December 17, 2024, 9:44am UTC](https://community.weweb.io/t/supabase-password-reset-flow-not-redirecting-to-reset-password-page/14995 "2024-12-17T09:44:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eva](https://avatars.discourse-cdn.com/v4/letter/e/dbc845/32.png) [@eva](https://community.weweb.io/u/eva)\
**Post date:** [December 17, 2024, 9:44am UTC](https://community.weweb.io/t/supabase-password-reset-flow-not-redirecting-to-reset-password-page/14995/1 "2024-12-17T09:44:52Z")

</div>

Hello everyone!

I’m implementing Supabase authentication in my Weweb project and having an issue with the password reset flow. When a user clicks the reset password link from their email:

1. The URL briefly shows the access token:  
[mydomain.com/#access\_token=[long-token-string]&type=recovery](http://mydomain.com/#access_token=%5Blong-token-string%5D&type=recovery)

2. But then immediately redirects to the homepage instead of my reset password page.

I’ve tried:

- Setting up redirect URLs in Supabase URL Configuration
- Configuring the Supabase Auth plugin in Weweb
- Modifying the reset password email template
- Adding redirections in Weweb

Current setup:

- Have a working reset password page at /reset\_password
- Supabase Auth plugin configured in Weweb
- Email template with default confirmation URL

How can I properly handle the access token and redirect users to the reset password page while maintaining the token?

---

<div class="post-metadata">

**Author:** ![GeovanyFerreira](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/geovanyferreira/32/13093_2.png) [@GeovanyFerreira](https://community.weweb.io/u/GeovanyFerreira)\
**Post date:** [December 17, 2024, 11:59am UTC](https://community.weweb.io/t/supabase-password-reset-flow-not-redirecting-to-reset-password-page/14995/2 "2024-12-17T11:59:54Z")

</div>

Hello, this video shows the complete process, it is in Portuguese, but with the subtitles and following along you can replicate it

[![](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/0/0a2679c03b2fdbb5221af1f887b9f7a46af0a71c.jpeg "Autenticação Completa Supabase com WeWeb - Login com Google, Reset de Senha, Configuração de SMTP") ](https://www.youtube.com/watch?v=-P23ZMTElRs)

---

<div class="post-metadata">

**Author:** ![MathiasS-B](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/mathiass-b/32/10201_2.png) [@MathiasS-B](https://community.weweb.io/u/MathiasS-B)\
**Post date:** [March 26, 2025, 8:14am UTC](https://community.weweb.io/t/supabase-password-reset-flow-not-redirecting-to-reset-password-page/14995/3 "2025-03-26T08:14:47Z")

</div>

(Repost for people like me looking for awnsers)  
So i have been working quite abit with the reset token.  
The standard flow is.  
Supabase emails the user with a url to supabase.  
user click link.  
Supabase create access token and redirect user to Weweb application,  
Weweb looks at the Access token in the URL like: {{WewebsiteURL}}#Access-token= eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30

Weweb saves this token and redirect user to same site with no token in the URL.  
User send new password to supabase with AccessToken provided.

* * *

The Weweb only works if there is a AccessToken provided from supabase.

Some times  
A problem arises when the users Mail program like Outlook, and some others: opens the supabase link to verify that its not a virus.  
if this happens, supabase gives the MailProgram the AccessToken and the mail program trashes the Accesstoken.  
When the User clicks the link, Supabase is like: "nahh bro. This link has already been used, you are not given a AccessToken. but you go to the weweb page and try.

Weweb then cant find the AccessToken in the URL and the user/weweb can’t provide a AccessToken for supabase to reset the Password and supabase returns the Errror No access tokenprovided.

Supabase Writes this in their documentation like this: [Email Templates | Supabase Docs](https://supabase.com/docs/guides/auth/auth-email-templates#email-prefetching)

As of now its not totally clear what we need to do in the weweb Documentation.

But I have the solution.

in your Supabase template instead of the {{ .ConfirmationURL }} write the href thing like this:  
a href=“{{ .RedirectTo }}?token={{ .Token }}&type=recovery&email={{ .Email }}”"

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/7/7723ab319439ec0817df412060b674a58a957fd7.png)

then in you Weweb page you need to use the workflow Verify OTP in your workflow. Taking the params in from the URL to log in the user with a single sign in operation. This makes the user logged in and the user can send their new password to Supabase.  
I made the work flow like this:  
Log the user in.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/1/15062c8181a18f17e26db1c000a68ecf882c2e8f.png)  
Verify the URL has the otp token and email:  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/0/0daf3074b39a189f91ad9e94baf76d04bb47b171.png)

Use weweb to log the user in and get the params

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/4/497a6df873bbdaddf23a2c8247dedb4bf6769ed4.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/b/b9dbaf11f17ce72b6838b7f12d3989cf8688977f.png)

And then the user is logged in.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/a/add8d118dff8c142320265bbfe11549dcfd3011a.png)

this will make the Set new password work.

I hope this makes sense.
