Adonis Person verify Email issue


#1

I’m using the Adonis Persona module to handle user management for my API. I ran into some issues when trying to verify user email address.

I have a route Route.post('auth/verify-email/:token', 'UserController.verifyEmail' and my verify email method is

async verifyEmail ({ params }) {
    const user = await Persona.verifyEmail(params.token)
    return user
 }

The problem is, the token that was generated for a particular user was fc2b16edae0eff2bc180649d1553cd692v/UCws8fxHmYWPrZoaSzk3F73x58zTCJKEExdYB7hY= so it returns a route not found error as it’s treated as a totally different route because of the forward slash in the token.

How do I resolve this issue?


#2

Use querystring.escape method to escape the token and then send it via email.


#3

Thanks. Works fine. For some reason, I totally forgot that escaping it will solve the problem. Thanks once again