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

feat: email verification #383

Merged
merged 69 commits into from
Oct 31, 2024
Merged

feat: email verification #383

merged 69 commits into from
Oct 31, 2024

Conversation

seelengxd
Copy link
Contributor

attempt 2

seelengxd and others added 30 commits October 31, 2024 14:02
-Move verify email page from unauthenticated to authenticated
-This requires the user to login before verifying
-Conditionally redirect user after login success
-If user has browser history, redirect user to previous page from browser history after login
-If user has no browser history, redirect user to Jippy home page after login
-This is slightly more convenient for users
-Modify the frontend messages on the verify email to sound nice
-Update redirect now component to be a span that performs an onClick() function instead of just redirecting to home
-Improve redirect after successful verification to selectively redirect to previous or home page depending on user's browser history
-Potentially fix multiple runs of the verify backend call from the frontend(pending testing)
-Add new UnverifiedAlert component to be displayed when the user is logged in but has not verified their email
-Selectively display new UnverifiedAlert component below navbar when user logs in but haven't verified their email(tier_idcorresponds to that of unverified)
-Add validation for whether user is verified on the billing page
-If user is unverified, disable all subscription buttons and also add the UnverifiedAlert banner to remind the user to verify their email
-Only if the user is verified, then enable the subscription buttons and remove the UnverifiedAlert banner
-Generate updated client ts with openapi-ts
-Update user.tier_id to free tier after successful email verification
-Implement sending HTTP requests to the backend to complete email verification or resend email verification
-Tested to be working
-Check both user.verified and user.tier_id to determine whether a user is verified instead of only checking user.tier_id
-Add query helper function for completing email verification
-Don't indefinitely stretch the width of the SubscriptionCard component as the viewport gets wider
-Set max width of 400px
-Add comment about an idea for future extension of the SubscriptionCard component
-Refactor duplicate logic into a new sub-component SubscriptionDetail
-This improves code readability
-Center align elements in SubscriptionCard's CardDescription
-Set height contraint of CardDescription element in SubscriptionCard component to fit content
-Add new tierIDToPrice() helper function to convert user.tier_id to their corresponding numeric prices
-Greatly simplify the use of SubscriptionCard by only taking 1 prop now
-Implement internal parsing logic to obtain the various variables required to display the subscription details
-Update billing page after the SubscriptionCard component update
-Implement conditional rendering for unverified user
-Now the card becomes half disabled and is themed red with an Alert warning to strongly remind the user to verify their email
-Stop conditionally rendering the 'Your Tier' section and rely on the conditional rendering inside SubscriptionCard instead
-Update ask question page to render the next Mon's date instead of hardcoding a specific date
-Refactor reused logic into a separate component for easier maintenance and code readability
-Use the existing LimitAlert to warn the user to verify their email when the user is still unverified
-Use conditional rendering to display the actual, existing limit alert logic when the user is already verified
-Add unverified tier ID as a const at types/billing.ts to reduce hardcoding and ease maintenance
-Modify essay feedback page to display a new Alert when the user is unverified using conditioal rendering
-Disable all text fields and the submit button to prevent an unverified user from ever submitting essays for feedback without verifying their email
-In case the user somehow manages to submit essays for feedback without verifying their email, display an Alert to warn the user to verify before trying to do so
-Improve alignment of the unverified alert by adding margin above it
-Update LimitAlert component on ask page to remove red background
-This standardises the background color(none) of the alert components we have so far
-Probably a merge conflict that was resolved wrongly
-Somehow syntax errors occurred after linting and an import disappeared, fix these
@haoyangw haoyangw marked this pull request as ready for review October 31, 2024 21:46
@haoyangw
Copy link
Contributor

Tested with the full email verification workflow and works

@haoyangw haoyangw merged commit ca59cba into main Oct 31, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants