Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confirm email directly to the server #1

Open
paean99 opened this issue Jan 13, 2019 · 1 comment
Open

Confirm email directly to the server #1

paean99 opened this issue Jan 13, 2019 · 1 comment

Comments

@paean99
Copy link

paean99 commented Jan 13, 2019

First thanks for this series

I just wanted to add that you can send the confirm url directly to the graphql server (http://localhost:4000/graphql).
Just do a post request with an hidden form and inputs inside the email.
More can be seen here:
https://www.apollographql.com/docs/apollo-server/requests.html or here https://graphql.org/learn/serving-over-http/

Some attention is needed for the value of the hidden input element. The graphql query/mutation needs double quotes inside (i believe), so it would have to be wrapped inside single quotes or maybe use something like " ?

You would have to use a button which is different from a link. But the button can always be styled as a link if necessary.
And also avoid using javascript. Some email providers may not like it as it can be seen as dangerous.

One much simpler alternative is to just use a get request. The advantage is that no form is needed, only a link tag. It would have to call a query (with the token as argument) and not a mutation. Although a little strange in this case (mutation seems to be the correct one), it should work.

For more practical info, one can just do several request in a graphql playground and see the request payload in the network tab of the dev tools.

edit:
Forgot to add that this post was just to mention an alternative solution. But i personally think that independently of the solution, the important part is to give feedback to the user about the confirmed email.

@benawad
Copy link
Owner

benawad commented Jan 14, 2019

thanks for writing this, that's a nice alternative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants