Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Display error messages #426

Merged
merged 5 commits into from
May 14, 2021
Merged

Conversation

donmhico
Copy link
Contributor

@donmhico donmhico commented May 6, 2021

Closes #398

Description

Display the error message in the login or registration page via state instead of redirecting to the same page with the error message in the url.

Error messages for registration are from backend, see WebDevStudios/wds-headless-wordpress#27.

Login error messages are defined here in the front end. Unlike registration, WP GraphQL sends back the error code instead of error message in login() mutation. I tried looking for a filter which can be used to filter the response on login and the closest I can find is graphql_request_results but when I tried to use this filter it proved rather hard to change response from error code to actual message. So for now, the error message are defined in the front end. My concern to this solution is internationalization which can be discussed/addressed in another ticket.

Links

Login - https://nextjs-wordpress-starter-d74djk0x5-webdevstudios.vercel.app/login
Registration - https://nextjs-wordpress-starter-d74djk0x5-webdevstudios.vercel.app/register

Screenshot

Screen Shot 2021-05-07 at 1 39 10 AM

Screen Shot 2021-05-14 at 2 11 47 AM

Verification

How will a stakeholder test this?

  1. Try to perform an invalid / failing registration or login.

Note

This PR should be merged for the registration error messages to display properly.

@donmhico donmhico self-assigned this May 6, 2021
@vercel
Copy link

vercel bot commented May 6, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/webdevstudios/nextjs-wordpress-starter/AN4xveLy5FgXaAeivrUYVMSg1Gor
✅ Preview: https://nextjs-wordpre-git-bugfix-398-display-error-message-for-2a1c83.vercel.app

@donmhico donmhico marked this pull request as ready for review May 13, 2021 18:19
Copy link
Contributor

@gregrickaby gregrickaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. If @ravewebdev is on board, let's merge it in! Thanks, @donmhico!

Copy link
Contributor

@ravewebdev ravewebdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@donmhico donmhico merged commit 6c45aff into main May 14, 2021
@donmhico donmhico deleted the bugfix/398-display-error-message-for-auth branch May 14, 2021 16:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display error messaging for login/register process
3 participants