Fix/require successful onboarding - #240
nishthefish06 wants to merge 9 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ZeyadAbbas
left a comment
There was a problem hiding this comment.
I have left 3 comments on 3 different files, please check them and make the necessary fixes.
There was a problem hiding this comment.
This layout only protects page rendering. An authenticated but incomplete user can still call /api/trpc directly because protectedProcedure checks only for a session. Note creation/upload, reports, saves, and ratings remain accessible. Add an onboarding-aware tRPC middleware/procedure for protected operations, while leaving the onboarding update and account deletion endpoints exempt.
|
changes should have dealt with the necessary fixes |
|
Expanded on the previously reference issue #230 to aid with the task completion. |
Description
Before, users could sign up, skip onboarding, and still use the app with settings, note creation, and the home page all being reachable with an incomplete profile. This adds a shared protected layout which checks onboarding completion on every request and redirects to /get-started if onboarding has not been completed. Also fixed what seemed to be an issue with the major field in the onboarding schema.
Resolves
#230#251 #252 #253.Testing
On local host version, attempted logging in with a new account to trigger onboarding process. Attempted to access settings, note creation page, and home by using buttons and urls, and successful redirection back to onboarding always occurred.
AI Disclosure
Used GitHub copilot to find potential causes of issue and to help fix a conflict I ran into while pulling the refactor from the repo.
Checklist