Skip to content

fix: validate username and GitHub inline during signup - #27

Merged
neuromechanist merged 3 commits into
devfrom
feature/signup-inline-validation
Jan 17, 2026
Merged

neuromechanist merged 3 commits into
devfrom
feature/signup-inline-validation

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

  • Add /auth/check-username endpoint to verify availability immediately
  • Add /auth/check-github endpoint to verify GitHub user exists immediately
  • Change description from editor (vim) to inline text input
  • Validate each field right after entry to avoid losing input on errors

Fixes #9

Test plan

  • Lint passes
  • Type check passes
  • All tests pass
  • Manual test signup flow with invalid username
  • Manual test signup flow with invalid GitHub username
  • Deploy backend to test endpoints

- Add /auth/check-username endpoint to verify availability
- Add /auth/check-github endpoint to verify GitHub user exists
- Change description from editor to inline input
- Validate immediately after each field entry

Fixes #9
@github-actions

github-actions Bot commented Jan 17, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR27

Version: 0.3.0-PR27.eef10e2
Commit: eef10e2


🤖 Updated on each push.

- Add try-catch to backend endpoints
- Use COLLATE NOCASE for case-insensitive username check
- Trim input before validation
- Distinguish network errors from server errors in CLI
@neuromechanist

Copy link
Copy Markdown
Contributor Author

PR Review Summary

Issues Found and Fixed

Critical Issues (Fixed):

  1. Silent catch blocks - CLI validation was swallowing all errors. Now distinguishes network errors from server errors.
  2. Missing try-catch in backend - Added error handling to both endpoints with proper 503 responses.
  3. Case-sensitivity - Added COLLATE NOCASE to username check to prevent "John" and "john" as different users.

Important Issues (Fixed):
4. No input trimming - Added .trim() to query parameters.

Testing Completed

  • Lint passes
  • Type check passes
  • All 119 tests pass
  • Backend deployed and endpoints tested
  • Trimming works: " neuromechanist " -> neuromechanist
  • Case-insensitive check works

Endpoints Verified

# Username available
curl "https://api.osc.earth/nemar/auth/check-username?username=testuser123"
{"available":true}

# GitHub valid
curl "https://api.osc.earth/nemar/auth/check-github?username=neuromechanist"
{"valid":true,"username":"neuromechanist"}

# GitHub invalid
curl "https://api.osc.earth/nemar/auth/check-github?username=notarealuser12345"
{"valid":false}

@neuromechanist neuromechanist linked an issue Jan 17, 2026 that may be closed by this pull request
@neuromechanist
neuromechanist merged commit 602ac48 into dev Jan 17, 2026
@neuromechanist
neuromechanist deleted the feature/signup-inline-validation branch January 17, 2026 21:00

This branch was previously deployed

1 inactive deployment
npm — 865be8d3 Deployed Jan 17, 2026 by neuromechanist
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.

nemar login user experience

1 participant