Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

docs(auth): document the OTP verification flow on register, verifyOtp, resendOtp#196

Merged
wixysam merged 1 commit into
mainbase44/javascript-sdk:mainfrom
fix-register-verifyotpbase44/javascript-sdk:fix-register-verifyotpCopy head branch name to clipboard
Jun 10, 2026
Merged

docs(auth): document the OTP verification flow on register, verifyOtp, resendOtp#196
wixysam merged 1 commit into
mainbase44/javascript-sdk:mainfrom
fix-register-verifyotpbase44/javascript-sdk:fix-register-verifyotpCopy head branch name to clipboard

Conversation

@wixysam

@wixysam wixysam commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • The register() example was missing the verifyOtp() step. Developers who followed the docs ended up with unverified users who could not log in. The example now shows register, verifyOtp, then loginViaEmailPassword().
  • verifyOtp() JSDoc now explains what verification actually does, links the surrounding methods, and includes a second example covering the full registration flow.
  • resendOtp() JSDoc explains when to call it and links back to register() and verifyOtp().
  • @returns descriptions stay in prose since the methods still return Promise<any>. A follow-up PR will introduce real response types.

Follow-up

There's an open question about whether verifyOtp() should call setToken() after success, since the backend already issues a JWT and sets a cookie. That belongs in the typing PR, not this doc fix.

Test plan

  • npm run create-docs-local generates clean mintlify output for auth.mdx.
  • The Register, verifyOtp, and resendOtp sections render correctly in the mintlify dev server.

🤖 Generated with Claude Code

…, and resendOtp

The register() example was missing the verifyOtp() step, so developers who
followed the docs ended up with unverified users who could not log in. The
verifyOtp() and resendOtp() JSDoc was also thin and lacked example titles.

- register(): example now shows register, verifyOtp, then loginViaEmailPassword.
- verifyOtp(): describes what verification accomplishes, links the surrounding
  methods, and adds a second example covering the full flow.
- resendOtp(): explains when to call it and links back to register and
  verifyOtp.
- Returns descriptions stay in prose since the methods still return
  Promise<any>. A follow-up PR will introduce real response types.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@claude

claude Bot commented Jun 10, 2026

Copy link
Copy Markdown

Claude finished @wixysam's task —— View job


PR Review: OTP Verification Flow Documentation

I've reviewed the documentation changes for the auth module's OTP verification flow. Here's my comprehensive feedback:

✅ Code Quality and Best Practices

The documentation improvements are well-structured and follow JSDoc best practices:

  • Clear, descriptive method descriptions
  • Proper use of @linkcode for cross-referencing related methods
  • Comprehensive examples showing both isolated usage and complete flows
  • Consistent formatting and terminology

✅ Completeness and Accuracy

The changes effectively address the missing verification step:

  • register() now correctly documents that OTP verification is required (src/modules/auth.types.ts:364-367)
  • verifyOtp() explains what verification does and its role in the registration flow (src/modules/auth.types.ts:400-404)
  • resendOtp() clearly indicates when to use it and links back to the flow (src/modules/auth.types.ts:425-428)
  • Examples demonstrate the complete flow: register → verifyOtp → loginViaEmailPassword

⚠️ Minor Suggestions

  1. Return type clarity: While you mentioned that proper response types are coming in a follow-up PR, consider adding a brief note in the @returns descriptions about what data developers can expect (e.g., "includes access_token for the verified user").

  2. Error handling examples: The verifyOtp examples show error handling, which is great. Consider adding similar try-catch blocks to the register() example for consistency.

✅ Security Considerations

The documented flow follows security best practices:

  • Email verification required before account activation
  • Clear separation between registration and authentication
  • Proper OTP expiration handling with resend functionality
  • No sensitive information exposed in examples

✅ No Performance Concerns

Documentation changes only - no runtime impact.

📋 Test Coverage

The test plan mentions:

  • Mintlify documentation generation
  • Visual verification in dev server

This is appropriate for documentation-only changes. The plan correctly focuses on verifying the documentation renders properly rather than testing runtime behavior.

Summary

This PR successfully addresses a critical documentation gap that was causing developers to create unverified users. The changes are clear, accurate, and will prevent future confusion. The follow-up PR for proper typing will complement these documentation improvements nicely.

Verdict: Approved

@github-actions

Copy link
Copy Markdown

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/sdk@0.8.32-pr.196.8c75df2

Prefer not to change any import paths? Install using npm alias so your code still imports @base44/sdk:

npm i "@base44/sdk@npm:@base44-preview/sdk@0.8.32-pr.196.8c75df2"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "@base44/sdk": "npm:@base44-preview/sdk@0.8.32-pr.196.8c75df2"
  }
}

Preview published to npm registry — try new features instantly!

@wixysam wixysam merged commit b71b024 into main Jun 10, 2026
6 of 7 checks passed
@wixysam wixysam deleted the fix-register-verifyotp branch June 10, 2026 13:21
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.