Theme : Customise message in info.ftl depending on the previous page

Hello,

I implemented a custom theme and, in order to improve this customisation, I am looking for customise the message in info.ftl depending on the previous page.
I tried to create a script to set and get the name of the previous page but the value does not persist when the page is changed. Then I tried to find a property that would allow me to know which page was visited previously.
Example : I was on the page login-password-update.ftl and after updating my password I would like to display a message confirming the successful completion.
If anyone can help me, I would be very grateful.

I remain at your disposal if you need more information.
Thank you ! :slight_smile:

That’s not something you can do in the .ftl. However, you can override messages in the message properties files: keycloak/messages_en.properties at master · keycloak/keycloak · GitHub

I think the key you’re looking for is accountPasswordUpdatedMessage.

Thank you for response :slight_smile:
Do you know if it is possible to create a new page in order to redirect to this one.
If I verify an e-mail I would like to redirect to info.ftl and override the message accountUpdatedMessage (I already know how to override the message :wink:).
If I update my password I would like to redirect to info-password.ftl and override the message accountPasswordUpdatedMessage.

You can build a custom Authenticator that renders info-password.ftl, and then override the default “Reset Credentials” flow to included that. I can’t think of another way to change the flow and pages rendered.

Ok, thank you for your help ! I’ll look into it :slight_smile:

Did this work for you? I am stuck with a similar situation where after password reset I want to redirect to login page with a message confirming the successful completion. If so, can you please share a sample?