Skip to content

rename verifications functions names#31

Merged
cobraprojects merged 1 commit into
mainfrom
rename-verifications-fuctions
May 9, 2026
Merged

rename verifications functions names#31
cobraprojects merged 1 commit into
mainfrom
rename-verifications-fuctions

Conversation

@cobraprojects
Copy link
Copy Markdown
Owner

@cobraprojects cobraprojects commented May 9, 2026

Summary by CodeRabbit

  • New Features

    • Unified email verification APIs for token verification, sending, and resending across all platforms with consistent error handling.
    • Enhanced form validation for email verification workflows with improved error messages.
  • Documentation

    • Updated email verification and security documentation reflecting new standardized API implementations.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c4f4ac78-61d7-40c1-a43c-59e3ac2983dc

📥 Commits

Reviewing files that changed from the base of the PR and between b476b26 and 6dc2b5f.

📒 Files selected for processing (18)
  • apps/blog-next/app/api/verify-email/resend/route.ts
  • apps/blog-next/app/api/verify-email/route.ts
  • apps/blog-next/lib/schemas/auth.ts
  • apps/blog-nuxt/server/api/verify-email.post.ts
  • apps/blog-nuxt/server/api/verify-email/resend.post.ts
  • apps/blog-nuxt/shared/schemas/auth.ts
  • apps/blog-sveltekit/src/lib/schemas/auth.ts
  • apps/blog-sveltekit/src/routes/api/verify-email/+server.ts
  • apps/blog-sveltekit/src/routes/api/verify-email/resend/+server.ts
  • apps/docs/docs/auth/email-verification.md
  • apps/docs/docs/security.md
  • packages/auth/src/contracts.ts
  • packages/auth/src/index.ts
  • packages/auth/src/runtime.ts
  • packages/auth/tests/contracts.type.test.ts
  • packages/auth/tests/docs-smoke.test.ts
  • packages/auth/tests/package.test.ts
  • packages/core/src/portable/holo.ts

📝 Walkthrough

Walkthrough

This PR refactors email verification across the @holo-js/auth package and three blog app frameworks. It adds verifyEmail, sendEmailVerification, and resendEmailVerification functions to replace the prior namespace-based verification.consume() and verification.resend() calls, updates validation schemas for email resend across apps, and synchronizes tests and documentation.

Changes

Email Verification API and Integration

Layer / File(s) Summary
Type Contracts and Interfaces
packages/auth/src/contracts.ts
AuthEmailVerificationSendOptions interface added with optional guard and expiresAt. AuthFacade extended with verifyEmail(), sendEmailVerification() (overloads), and resendEmailVerification() (overloads) methods returning typed AuthResult values.
Runtime Implementation
packages/auth/src/runtime.ts
createEmailVerificationResendInput helper normalizes email and options. getAuthRuntime() facade wired with verifyEmail, sendEmailVerification, and resendEmailVerification delegating to existing verification methods. Top-level exported functions with TypeScript overloads added.
Package Exports and Core Bindings
packages/auth/src/index.ts, packages/core/src/portable/holo.ts
New functions verifyEmail, sendEmailVerification, resendEmailVerification re-exported from runtime. Type AuthEmailVerificationSendOptions exported from contracts. Frozen auth default object updated. HoloAuthRuntimeBinding interface extended with new methods.
Email Resend Validation Schemas
apps/blog-next/lib/schemas/auth.ts, apps/blog-nuxt/shared/schemas/auth.ts, apps/blog-sveltekit/src/lib/schemas/auth.ts
resendEmailVerificationForm schema added to each framework's auth schemas; validates required, valid email address.
Email Verification Endpoints
apps/blog-next/app/api/verify-email/route.ts, apps/blog-nuxt/server/api/verify-email.post.ts, apps/blog-sveltekit/src/routes/api/verify-email/+server.ts
Import updated from verification to verifyEmail. Token verification call switches from verification.consume(token) to verifyEmail(token). Error handling and success response logic remain unchanged.
Email Resend Endpoints
apps/blog-next/app/api/verify-email/resend/route.ts, apps/blog-nuxt/server/api/verify-email/resend.post.ts, apps/blog-sveltekit/src/routes/api/verify-email/resend/+server.ts
Imports switch from verification and request-body parsing to resendEmailVerification, form validate, and resendEmailVerificationForm. Request validation via form submission. Resend call uses resendEmailVerification(email) instead of verification.resend(). Response structure changes from { ok, status, data/errors } to form submission success/failure objects.
Type and Runtime Tests
packages/auth/tests/contracts.type.test.ts, packages/auth/tests/package.test.ts, packages/auth/tests/docs-smoke.test.ts
Type contract assertions extended for verifyEmail, sendEmailVerification, resendEmailVerification with parameter and return type validation. Package tests refactored to use new helpers; email verification token lifecycle updated from verification.consume() to verifyEmail(). Resend test expanded to exercise runtime and top-level send/resend entry points. Documentation smoke test updated to assert new API names.
User and Developer Documentation
apps/docs/docs/auth/email-verification.md, apps/docs/docs/security.md
Email verification doc updated with verifyEmail(token) and resendEmailVerification(email) examples replacing verification.consume() and verification.resend(). Security doc list of auth helpers returning auth failures updated to include verifyEmail().

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • cobraprojects/holo-js#19: Directly related — both modify email-verification code paths and replace verification.consume/resend with new verifyEmail/resendEmailVerification APIs across routes/schemas/exports.
  • cobraprojects/holo-js#24: Related — both update email verification routes and replace verification.consume with verifyEmail with adjusted post-verification flow/redirect logic.
  • cobraprojects/holo-js#28: Related — both modify email verification handlers and validation/response flows in POST verify-email and resend endpoints.

Poem

🐰 From tokens old to functions new,
Email verification breaks through,
Resend and verify, clean and bright,
Three frameworks dance in perfect light,
Tests confirm the schemas sync,
All in place with one smooth link! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'rename verifications functions names' is vague and generic, using non-descriptive terms that don't convey meaningful information about what was actually refactored in the changeset. Consider a more specific title that describes the actual changes, such as 'Replace verification namespace with dedicated functions for email verification' or 'Introduce verifyEmail, sendEmailVerification, and resendEmailVerification helpers'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rename-verifications-fuctions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cobraprojects cobraprojects merged commit 9a38e26 into main May 9, 2026
1 check passed
@cobraprojects cobraprojects deleted the rename-verifications-fuctions branch May 9, 2026 16:41
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.

1 participant