-
Notifications
You must be signed in to change notification settings - Fork 3
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
User registration #9
Conversation
koffeinfrei
commented
Nov 23, 2018
•
edited
Loading
edited
- user registration
- limit free subscription to 100 notes
- Show "welcome" note after registration
the location is not consumed by the client anymore, so we can fall back to the default implementation.
this way we can destroy a user
d7b5542
to
514bfea
Compare
514bfea
to
78f4ff6
Compare
9f63df8
to
f64c1d4
Compare
25c8a04
to
73bd6d7
Compare
client/src/RegistrationForm.js
Outdated
const errors = responseJSON.errors.join('<br>'); | ||
|
||
AlertFlash.show('Sorry, that did not work. You need to fix your inputs:<br>' + errors) | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you want to have jquery-less solution you could do:
- instead of using serialize, you might get the data like in one of these approaches: https://stackoverflow.com/a/47678799
- personally, i always use controlled inputs where you define
value
andonChange
for every form field and save the values in a state. It's more work, but its somewhat more clear, because it does not rely on the browser-api and also works similarly on environments like react-native., see this answer: https://stackoverflow.com/a/23428536
for $.ajax you could use the new fetch
-api which is native to all modern browser and can be polyfilled: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
personally, i always use controlled inputs
You're right, that's the proper way to do react.
for $.ajax you could use the new fetch-api
Dropping jquery is a midterm goal anyway, but I'll have to get rid of bootstrap first (hence, a redesign).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@macrozone Updated in 64bb19c.
1. errors are out of the viewport, esp. on mobile 2. after registration, the welcome message is not visible
react doesn't send the value with controlled inputs if the field is left empty. that way the password confirmation is not needed and would create the user without it.
3af3695
to
fd059df
Compare
48e830b
to
9e30ac3
Compare