Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RESET_PASSWORD_URL default not working and override also #434

Closed
mihaa1 opened this issue Dec 4, 2023 · 7 comments
Closed

RESET_PASSWORD_URL default not working and override also #434

mihaa1 opened this issue Dec 4, 2023 · 7 comments

Comments

@mihaa1
Copy link

mihaa1 commented Dec 4, 2023

Reset password email - link to the reset password is

app.url/?token=123

and not

app.url/reset-password/?token=123

I tried setting the env var also and that didn't work.

@lakhansamani
Copy link
Contributor

@mihaa1 can you share env variable value and some reproducible steps
Thanks

@mihaa1
Copy link
Author

mihaa1 commented Dec 4, 2023

I tried using local instance and prod on railway.
Initially /reset-password was good for me - I create a page with this path in my app, without setting the RESET_PASSWORD_URL env var.

But I saw the link from the email points to app.url?token=123 and not app.url/reset-password/?token=123
Then I tried setting it in the .env in the local instance and in env vars in railway on production instance.
Both didn't work.

I'm trying to understand whether I'm missing something and this env var is not supposed to do what I think.

@lakhansamani
Copy link
Contributor

@mihaa1 so this is how the reset password URL is decided

priority 1: if redirect_uri passed as param to forgot_password
priority 2: if RESET_PASSWORD_URL is set in env (Note: this should be full URL https://some_frontend_app.url/...
priority 3: if none of the above is set we use the default app reset-password /app/reset-password prefixed with your authorizer instance URL

@mihaa1
Copy link
Author

mihaa1 commented Dec 5, 2023

  1. where does redirect_uri passed? Im using the react sdk and the full component. The component controls the forgot password
  2. setting RESET_PASSWORD_URL=http://localhost:5173/login is not working. The email is sent with the link http://localhost:5173?token=123

@lakhansamani
Copy link
Contributor

This is happening because of the react-sdk
let me add prop there in react SDK for this 👍
I suppose you are using Authorizer component right?

@mihaa1
Copy link
Author

mihaa1 commented Dec 6, 2023

I suppose you are using Authorizer component right?

YES!
thank u!

But why isn't it working when setting the env var?

@lakhansamani
Copy link
Contributor

@mihaa1 after digging more into the code, I found a possibility where you can do this
Just add redirect_uri in your URL when rendering <Authorizer> component

example https://localhost:8080/forgot-password?redirect_uri='https://abc.com/reset-password'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants