Custom 400 page after twice click in activate link

System Information
  • Strapi Version: v3.6.8
  • Operating System: MacOs
  • Database: Postgres
  • Node Version: v14.17.5

Hi!

I have a question. Some users of my app noticed an interesting thing.
In my Strapi app, I have enabled email confirmation. When you click twice in activating link, you see a 400 error with the message “token.invalid”.

image

I think this isn’t user-friendly. Is there a way to add a custom 400 page in that case? Or maybe add a redirect to my frontend app?

Thanks for your answers! :slight_smile:

Hi, I found a solution!

If you want to change the default behaviour of emailConfirmation link, You can overwrite emailConfirm function.

Just paste this function to /extensions/users-permissions/controllers/Auth.js file, and change the default behaviour of redirecting. :slight_smile:

Any idea if this still works in Strapi v 4.10.x ? I need to do change the redirect behavior to include the JWT for my front-end so I can log the user in right away.

I tried creating the auth.js file under src/extensions/controllers but it doesn’t seem to be picked up by Strapi at all.