[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>
This commit is contained in:
Eric Bailey
2025-12-09 16:42:41 -06:00
committed by GitHub
parent 4d50555e56
commit b47f5f023e
6 changed files with 129 additions and 6 deletions
+20 -1
View File
@@ -22,7 +22,10 @@ import {
import {useAgent, useSession} from '#/state/session'
import * as debug from '#/ageAssurance/debug'
import {logger} from '#/ageAssurance/logger'
import {isLegacyBirthdateBug} from '#/ageAssurance/util'
import {
getBirthdateStringFromAge,
isLegacyBirthdateBug,
} from '#/ageAssurance/util'
import {IS_DEV} from '#/env'
import {device} from '#/storage'
@@ -324,6 +327,22 @@ export async function getOtherRequiredData({
const data: OtherRequiredData = {
birthdate: prefs.birthDate ? prefs.birthDate.toISOString() : undefined,
}
/**
* If we can't read a birthdate, it may be due to the user accessing the
* account via an app password. In that case, fall-back to declared age
* flags.
*/
if (!data.birthdate) {
if (prefs.declaredAge?.isOverAge18) {
data.birthdate = getBirthdateStringFromAge(18)
} else if (prefs.declaredAge?.isOverAge16) {
data.birthdate = getBirthdateStringFromAge(16)
} else if (prefs.declaredAge?.isOverAge13) {
data.birthdate = getBirthdateStringFromAge(13)
}
}
const did = getDidFromAgentSession(agent)
if (data && did && birthdateCache.has(did)) {
/*