Commit Graph

22 Commits

Author SHA1 Message Date
Eric Bailey 11f0a7b968 Pipe in assuredAge into the bday check 2026-07-02 14:40:51 -05:00
Eric Bailey 0456562abf Pipe through deviceSignals for logical handling 2026-07-02 11:07:18 -05:00
Eric Bailey f099a99470 Handle birthday confusion by adding a util that determines if manually updating bday could even help 2026-07-02 10:20:59 -05:00
Eric Bailey f023e34bca Add location to NoAccessScreen, move around GPS request 2026-07-01 16:25:09 -05:00
Eric Bailey ff10228fb6 More flag cleanup 2026-07-01 10:34:51 -05:00
Eric Bailey d8c84057ea Gate age signals by platform and version 2026-07-01 10:28:18 -05:00
Eric Bailey f16e680ffd Add allowsDeviceVerification flag 2026-07-01 10:14:38 -05:00
Eric Bailey c0714be0ec Fix region key symmetry 2026-06-30 10:22:26 -05:00
Eric Bailey d683a03a86 Bump @atproto/api to 0.20.23, drop temporary AA config types
0.20.23 ships `additionalVerificationMethods` on the generated
ConfigRegion type, so the client-side AgeAssuranceConfigRegion
intersection and AgeAssuranceVerificationMethod alias are no longer
needed. Read the field directly off the generated type and type the
debug config as AppBskyAgeassuranceDefs.Config.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 19:26:18 -05:00
Eric Bailey fc7aefc2b4 Rename to additionalVerificationMethods, assume KWS always supported
Model only the methods permitted *in addition to* the always-supported
KWS flow, rather than a full method list. This prevents a region from
being configured as device-only, which would lock out web and any
platform without the native age API.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 18:50:28 -05:00
Eric Bailey 18f8d360cb Return an object from device-signals age data helper
Rename getAssuredAgeFromDeviceSignals to getAgeAssuranceDataFromDeviceSignals
and return an object instead of a bare number, leaving room to derive more
rule-engine inputs from the native response (declared vs. guardian-declared,
parental controls, platform verification status) as the rules grow.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 16:06:52 -05:00
Eric Bailey 6b94b68690 Store device signals as region-keyed map, resolve to current region
Persist on-device age signals client-side as a map keyed by
country[-region] string, so multiple regions can each retain their own
grant. Reads resolve to the user's current region via mergedGeolocation
(react-query `select` for the hook, a shared helper for the out-of-band
path), so a grant captured in one region never unlocks another.

- AgeAssuranceDeviceSignals is now a region-keyed map
- setDeviceSignalsForRegion merges a region's signals into the map
- useDeviceSignalsQuery select-resolves to the current region; cache
  keeps the full map for the writer + persistence
- getAssuredAgeFromDeviceSignals takes the already-resolved signals

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 15:31:38 -05:00
Eric Bailey 85f6031708 Bind device age assurance to its origin region, add KWS fallback
Device assurance can't be verified server-side (the OS gives only age
bounds, no signed attestation), so it's persisted client-side only. Bind
each cached grant to the region it was captured in so a TX grant can't
unlock another region.

- Add AgeAssuranceDeviceSignals (signals + originRegion); store the
  region-tagged record in the persisted cache instead of the raw response
- getAssuredAgeFromDeviceSignals now requires the current region to match
  the capture region
- Gate the native age request to native platforms (web returns a
  misleading default); web/new-device/declined falls back to KWS
- TX allows ['device', 'kws'] so the fallback path is real

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:38:51 -05:00
Eric Bailey e834167f81 Integrate on-device age verification into access decision
Wire the expo-age-range device signals (already plumbed) into the age
assurance access decision, gated per-region.

- Model verificationMethods on region config (AgeAssuranceConfigRegion)
  and add a debug US/TX region permitting the 'device' method
- Add region accessors + getAssuredAgeFromDeviceSignals in util
- Surface deviceSignals through the AA context and feed lowerBound in as
  assuredAge, matching the existing IfAssuredOverAge rules
- NoAccessScreen "Verify now" now prompts the OS in device regions and
  falls back to the KWS dialog when unavailable/insufficient
- Keep useDeviceSignalsQuery disabled so we never prompt on load; restore
  from the persisted cache only

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:21:47 -05:00
Samuel Newman 84c4223ff9 [Chat] Gate group chats for under-18 users (#10548)
Co-authored-by: Eric Bailey <git@esb.lol>
2026-06-09 06:31:22 -07:00
Eric Bailey 690b8184a1 Refactor age assurance flags and contexts (#10794) 2026-06-08 15:34:51 -05:00
DS Boyce 8c2e4c6fad Write chat declaration record in response to different events (#10216)
Co-authored-by: Eric Bailey <git@esb.lol>
2026-04-20 15:39:12 -05:00
Eric Bailey b3f775d1d8 [AAv2] Improve minimum age handling (#9650)
* Improve miminum age handling

* Update api sdk

* Fix bad import
2026-01-08 15:36:26 -06:00
Eric Bailey 37a73b1755 Don't overwrite more mod prefs than necessary (#9536) 2025-12-11 13:15:02 -06:00
Eric Bailey b47f5f023e [APP-1674] Add bday fallback for app passwords (#9513)
* Add bday fallback for app passwords

* Update birthdate copy, add isAppPassword handling on NoAccessScreen

* Update copy

* Update usage

* Bump API package

* HmmMMMmmm

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>

* s/a/your

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>

* Say hello

---------

Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>
2025-12-09 16:42:41 -06:00
Eric Bailey e3494a4882 [AAv2] Fix for mod screen (#9483)
* Add derived flags, add back disabled adult content for users under 18

* Update copy
2025-12-04 16:39:31 -06:00
Eric Bailey c4aef9f668 Age Assurance V2 (#9479)
* Age Assurance V2

* Tighten up test

* Add todos for sdk migration

* Align RQ versions

* Use useEffect for side effect

* Improve effects, memoize

* Standarize on birthdate

* Copy feedback

* Copilot

* Add support link

* Reove double ..

* Cleanup

* Remove redirect dialog

* Cleanup todos, add comments

* Update splash in main template too

* Mock some stuff

* Exhaustive checks

Co-authored-by: Samuel Newman <mozzius@protonmail.com>

* Exhaustive checks

Co-authored-by: Samuel Newman <mozzius@protonmail.com>

* Small fix to bday handling

* Add comment

* onboarding style tweak

sneaking this in sorry!

* rm unreachable breaks

* Put useIntentHandler back on web

* Remove misleading success set

* Align on birthdate

---------

Co-authored-by: Samuel Newman <mozzius@protonmail.com>
2025-12-04 15:20:00 -06:00