- if auth redirect to homepage with a flash message "you're already signed in"
- check if all fields are valid and not empty
- activate loading on submit
- disable all button and input when loading is on
- check if email exist if yes return an error message under email field and turn off loading.
- check if user exist if yes return an error message under username field and turn off loading.
- save the email and password on the accounts table.
- send verification link to account's email.
- save the username, about, first name and lastname on the user table.
- redirect to "/", return flash a error message
- redirect to sign in page and flash a success message
- when routing to sign in page add "?previous=< currentpath >"
- if auth redirect to homepage with a flash message "you're already signed in"
- check if all fields are valid and not empty
- disable all button and input when loading is on
- check if the email and password match and if not return flash error message that the password or email is invalid
- after signing in redirect to the value of ?previous=< url > or "/"
- if user is not verified redirect to resend verification with flash message
- if user is verified and doesn't have a user in database redirect to update profile page
- if not auth redirect to sign in with error flash message "you're not logged in"
- when routing to sign in page add "?previous=< currentpath >"
- if already verified redirect to "/" with flash success message "your account is already verified"
- update the verified field to true
- if there is an error redirect to "" with error flash message "something went wrong"
- redirect to home with success flash message
- if no verifytoken in url params return 404
- if token is expired return "verify email token is expired"
- if token is invalid return "verification is invalid"
- if success redirect to sign in page if not auth or in home if auth with flash message "verification email success"
- check if all fields are valid and not empty
- activate loading on submit
- return a flash error message
- redirect to home and flash a "please check your email for the reset link" success message.
- if no resetToken in url params return 403
- if resetToken is expired return "reset password is expired try again later"
- check if all fields are empty
- activate loading on submit
- redirect to "/" and flash an error message
- redirect to login and return a success flash message
- if not auth redirect to sign in and flash an error message
- check if the password fields are empty.
- check again if token is still valid before submitting
- if the old password is incorrect return a field error
- activate loading on submit
- update the password.
- return a flash error message
- if success flash a message without redirect.
- reset all fields.
- turn off loading.
- if not auth redirect to sign in and flash an error message
- check if the file is a valid image.
- check if the fields are empty.
- check again if token is still valid before submitting
- activate loading on submit
- redirect to "/" and flash an error message.
- turn off loading.
- if success flash a message without redirect.
- turn off loading.