activescott / activescott/auth

EmailProvider accepts dotless email addresses (e.g. scott@willeke) and attempts delivery

オープン
#68 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
0
フォーク
1
PR マージ指標
30日以内にマージされた PR はありません

説明

## Problem

During fernfiles' rollout a user typo'd `scott@willeke` (no TLD) into the sign-in form. HTML `type=email` accepts dotless domains, and `EmailProvider.initiate` performed no address validation of its own — it accepted the identifier, created the user/identity via the store, and would have attempted SMTP delivery to an unroutable address. The app only caught it downstream (an admin-approval notification for a garbage identity).

## Ask

1. **Server-side**: `EmailProvider` (or a shared identifier-validation hook in `@activescott/auth`) should reject clearly-invalid email addresses at initiate, before any store writes or transport sends. A pragmatic default: require `local@domain.tld` (dot in the domain), configurable/escape-hatchable for intranet cases (`user@localhost`). Returning the standard validation-error redirect (the same path as a missing address) gives every consumer app the fix for free.
2. **Docs/example**: the react-router example's sign-in form could add `pattern=".+@.+\..+"` + `title` alongside `type=email` so the browser catches it first (fernfiles now does this — activescott/fernfiles#6).

## Why the library and not the app

Every consumer must otherwise re-discover this: identity providers own identifier semantics (the SMS provider presumably validates E.164 — email deserves the same). The store-write side effect makes it worse than a failed send: apps that key approval workflows on identities (fernfiles' waitlist) accumulate junk identities from typos.

Context: found while debugging activescott/fernfiles sign-in (fernfiles#6).

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。