Skip to content

[cookbook] Form validation throws CORS error for a codepen sample #2391

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

Closed
msamsel opened this issue Nov 17, 2019 · 5 comments · Fixed by #2410
Closed

[cookbook] Form validation throws CORS error for a codepen sample #2391

msamsel opened this issue Nov 17, 2019 · 5 comments · Fixed by #2410
Labels

Comments

@msamsel
Copy link

msamsel commented Nov 17, 2019

Hi,

when I read this article: https://vuejs.org/v2/cookbook/form-validation.html#Server-side-Validation I've noticed that the linked sample is not working properly.
In the section "Server-side Validation" the codepen doesn't make a server-side validation due to CORS error. I followed also a link to API and try to make a direct call to it from my browsers and it looks like server is not available any longer.
Screenshot 2019-11-17 at 10 49 51

@phanan phanan assigned sdras and unassigned sdras Nov 17, 2019
@phanan
Copy link
Member

phanan commented Nov 17, 2019

/ping @cfjedimaster @sdras.

@cfjedimaster
Copy link
Contributor

Unfortunately there probably isn't a good answer to this. Any serverless fix like this will be based on someone's free account which could expire, the author could die, etc. I think the best thing would be to simply show the code and NOT have the user actually run it so we don't have to worry about it. I can do an edit in that fashion, but I'd like to hear from @sdras first on what the Vue folks would like.

@sdras
Copy link
Member

sdras commented Nov 24, 2019

I mean, it's always ideal that the user can run the code themselves to play around with it. Especially as a cookbook recipe.

Raymond, can you use your Netlify account? That account has some protections, that's probably as best we can do to ensure longevity here. If it turns out to not work, it's fine then to remove the codepen and keep the code, making the URL be something that shows it's an example.

@cfjedimaster
Copy link
Contributor

I'm happy using something on Netlify if yall (the Vue you, not the Netlify you ;) are fine with it. I'm busy this week and it's the holidays, so it may be the week after Thanksgiving.

@sdras
Copy link
Member

sdras commented Nov 24, 2019

Yes, it's the Vue me speaking :) the Vue docs are deployed on Netlify. You can use another service as you like as long as it's somewhat protected in the same fashion.

cfjedimaster added a commit to cfjedimaster/vuejs.org that referenced this issue Dec 5, 2019
Updates the server side code. Fixes vuejs#2391
phanan added a commit that referenced this issue Mar 4, 2020
* Update form-validation.md

Updates the server side code. Fixes #2391

* Update form-validation.md

I removed the server side code and updated the form code to use the right URL.

* Update form-validation.md

Update related to comments.

* Update src/v2/cookbook/form-validation.md

* Update src/v2/cookbook/form-validation.md

* Update src/v2/cookbook/form-validation.md

* Update src/v2/cookbook/form-validation.md

Co-authored-by: Phan An <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants