Enable email verification in publish workflow#2954
Conversation
Greptile SummaryThis PR refactors email verification enforcement from a build-time feature flag ( All seven issues raised in the previous review rounds appear to be addressed:
One dead-code path remains in Confidence Score: 4/5Safe to merge after removing the unreachable dead-code branch; all previous loop/redirect issues from prior reviews are now resolved. All seven previously flagged P0/P1 issues (infinite redirect loops, unreachable parent data, unguarded re-throws) have been addressed. The one remaining finding is a dead-code branch that does not affect runtime behaviour but could mislead future maintainers, warranting a 4 rather than a 5. src/routes/+layout.ts — dead code in the catch block's 'already on verify-email' fallback. Important Files Changed
Reviews (9): Last reviewed commit: "address greptile comments" | Re-trigger Greptile |
src/routes/(console)/+layout.ts
Outdated
| if ( | ||
| isCloud && | ||
| account && | ||
| !account.emailVerification && | ||
| isEmailVerificationEnabled(consoleVariables) | ||
| ) { | ||
| const isVerifyEmailPage = url.pathname === resolve('/verify-email'); | ||
|
|
||
| if (!isVerifyEmailPage) { | ||
| redirect(303, resolve('/verify-email')); | ||
| } |
There was a problem hiding this comment.
I think we should no longer have this client-side check. Instead, we relay on server throwing error, of specific type we configured on backend.
When we catch that specific type, we redirect to /verify-email endpoint
There was a problem hiding this comment.
This whole file feels like overkill. Some methods for 3 line codes, and isVerifyEmailRedirectError feels too complex. In the end, we just need to recognize 1 exception, we dont need anything crazy here.
What does this PR do?
(Provide a description of what this PR does.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)