• Resolved graphems

    (@graphems)


    Is there a way to customize the way error are handled, so that if there is a signature error or user doesn’t exists, that the error can be displayed as HTML if the request is from a browser? So this way user don’t get stopped with a json error return code only on the page?
    Thanks for this amazing plugin!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Nicu Micle

    (@nicu_m)

    Hello @graphems,

    An easy way would be to call the auth/validate endpoint first, in order to validate the JWT.
    If the JWT is valid, you redirect to autologin, if not, you can redirect to another page.

    Also, I’m planning to start working on a new feature that will allow you to set a custom redirect page for autologin in case that autologin is failing.

    I will keep you posted.

    Best regards,
    Nicu.

    Thread Starter graphems

    (@graphems)

    Awesome! Also just so you know I would be happy to pay for a premium version if you plan on adding more features.

    Plugin Author Nicu Micle

    (@nicu_m)

    Hello @graphems,

    I just checked the code, and it seems that I’ve already released this feature. Sorry for the confusion I’ve created. It is available starting with version 3.4.5 (11 April 2022).

    So, in order to not display a JSON file when the user uses a wrong JWT,
    you can create a page, and use the following shortcode to display the error message:

    
    [simple-jwt-login:request key="error_message"]
    

    After that, in the plugin settings, in the “Autologin” section, you will find an option called “Redirect on Fail autologin”.

    Just add there the URL where you want to be redirected in case the autologin fails(For example you can add the previously created page where you have the shortcode).

    I will update the documentation with this feature.

    Please let me know if this helps you. Also, feel free to suggest new features.

    Best regards,
    Nicu.

    Thread Starter graphems

    (@graphems)

    Awesome thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Customizing the error message for auto-login’ is closed to new replies.