Skip to content

Comments

refactor: added back support for did/PDS logins and passes the locale onto the oauth screen#1187

Merged
danielroe merged 2 commits intonpmx-dev:mainfrom
fatfingers23:chore/auth-modal-changes
Feb 8, 2026
Merged

refactor: added back support for did/PDS logins and passes the locale onto the oauth screen#1187
danielroe merged 2 commits intonpmx-dev:mainfrom
fatfingers23:chore/auth-modal-changes

Conversation

@fatfingers23
Copy link
Contributor

  • Handle input supports did/PDS logins and has some validation if it's a did or handle to show an error. Stripes the @ still
  • Passes the locale onto the OAuth screen. Only works for en, fr-FR, and ja-JP. So does a check then defaults ot en
  • Had a bug where reditect_to was not being passed for handle logins

@vercel
Copy link

vercel bot commented Feb 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 8, 2026 1:39am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 8, 2026 1:39am
npmx-lunaria Ignored Ignored Feb 8, 2026 1:39am

Request Review

@github-actions
Copy link

github-actions bot commented Feb 8, 2026

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
lunaria/files/en-GB.json Localization changed, will be marked as complete.
lunaria/files/en-US.json Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 18.75000% with 13 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/components/Header/AuthModal.client.vue 20.00% 11 Missing and 1 partial ⚠️
app/utils/atproto/helpers.ts 0.00% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 8, 2026

📝 Walkthrough

Walkthrough

This pull request introduces input validation and locale support to the authentication flow. The AuthModal component now validates handle inputs before OAuth redirects, displays error messages for invalid entries, and normalises input by trimming and removing special characters. Locale support is added throughout the authentication pipeline, including the OAuth redirect construction and server-side locale resolution constrained to supported locales (en, fr-FR, ja-JP). Translation strings for validation error messages are added to English locale files. The ATProto syntax validation library is integrated into the build configuration via Nuxt modules and Vite optimisation.

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The PR description accurately relates to the changeset, covering input validation for DIDs/handles, locale passing to OAuth, and the redirect_to bug fix.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/components/Header/AuthModal.client.vue (1)

49-56: ⚠️ Potential issue | 🟠 Major

Only strip a leading “@” to avoid changing valid input.
Removing every “@” can turn an email-like string into a different, valid-looking handle and bypass the intended validation.

Proposed fix
-  const normalized = newHandleInput.trim().toLowerCase().replace(/@/g, '')
+  const normalized = newHandleInput.trim().toLowerCase().replace(/^@+/, '')
🧹 Nitpick comments (1)
server/api/auth/atproto.get.ts (1)

16-18: Replace the informal locale note with a concise description.
The current comment is conversational and doesn’t explain non-obvious logic. A short neutral note (or removal) would be clearer.

Proposed tidy-up
-//I did not have luck with other ones than these. I got this list from the PDS language picker
+// Supported OAuth UI locales from the PDS language picker.
 const OAUTH_LOCALES = new Set(['en', 'fr-FR', 'ja-JP'])
As per coding guidelines, “Add comments only to explain complex logic or non-obvious implementations”.

@danielroe danielroe added this pull request to the merge queue Feb 8, 2026
Merged via the queue into npmx-dev:main with commit cb040c4 Feb 8, 2026
17 checks passed
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