CodeHubOrg / codehub-mentorships

CodeHub Mentorship platform - built with Laravel and React
3 stars 0 forks source link

Katja/formvalues and registration #76

Closed katjad closed 4 years ago

katjad commented 4 years ago

Registration

This adds the standard registration process via email, and also includes email verification. (I have not restricted any of the existing pages, but have added a component Home/Index.tsx that is only accessible after verification - and indeed currently only says 'Thank you, your account has been verified')

For the email verification on local, I think it is easiest to write the email to the log. Note: In the .env file, you have to rename MAIL_DRIVER to MAIL_MAILER. This variable has to be set to: log.

(The VerificationController overrides methods from the laravel/ui package, because I wanted the link in the email to work event if the user is not logged in. I think I am doing it in a bit of a clunky way, but it works. If anything obvious can be improved, please go ahead, otherwise something to revisit later!)

Keeping form values

After failed server-side validation of a form submission, the previously entered values are now displayed in the form. This is through the InertiaServiceProvider, which gets the old values from the session. They are then fed into the Form.tsx component via Inertia's usePage() method.