So I implemented the "disable sign up/implement invite flow" and it works. But I want to change Supe...
s
So I implemented the "disable sign up/implement invite flow" and it works. But I want to change Supertoken's submitNewPassword component title to instead of a "Change Your Password" to "Set Password" since it makes sense in a invite flow. I looked at the doc and found embed in a page but when I do that for some reason it reloads the url to not having the reset token in the url. so it ends up showing the Reset Your Password component and the user needs to enter their email again which is not right. I am using Next.js I tried looking into the ResetPasswordUsingToken but all it says was:
Copy code
declare const ResetPasswordUsingToken: (prop?: any) => JSX.Element;
It looks like I can pass in a prop but I don't know what props I can pass or not. I don't know if I am even in the right path. If there is anyway to change the text I am grateful.
r
hey @Sekai
@porcellus can help here.
p
hi
I think the easiest way to achieve changing the title is to provide a new "translation" for
EMAIL_PASSWORD_RESET_SUBMIT_PW_HEADER_TITLE
r
The problem with that is for regular password reset flows, the title will be changed as well
Do you know why the embedding would cause an issue with the token disappearing?
p
I'm not aware of any issues there. To figure that part out I'll need to see a bit more of how the component was embedded.
s
Hi I implemented the embed by following steps 1 and 2 of https://supertokens.com/docs/emailpassword/common-customizations/reset-password/embed-in-page. But I still needed to show the component so I did this in the auth/[[..path]] file:
I tried getting the token but it redirects so I couldn't get it
I might try the tranlation without the embedding if that works
p
which version of the SDK are you using?
s
I am using these
p
and what is the path you are embedding the reset password page on?
what might be happening, is that you are redirecting to
/auth/XX
that handles showing the
ResetPasswordPage
(XX being something non-standard). This will make
canHandleRoute
return false, since it's not a standard route we can handle. This causes
redirectToAuth
to run, which could make the token disappear.
I'm also unsure about `ResetPasswordPage`: how are you changing the title only or did you build your own password reset page?
s
the path is auth/reset-password
I got the title change working with the language translation you sent
Maybe I don't need to use embed feature but I use tailwind for the styling and want to use that as well because we use some tailwind to implement branding styles
I think I figured it out. The language translation helped in my scenario and didn't need the embed feature
Thanks for the help
p
happy to help 🙂
5 Views