about summary refs log tree commit diff
path: root/src/state/session/util/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/session/util/index.ts')
-rw-r--r--src/state/session/util/index.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/state/session/util/index.ts b/src/state/session/util/index.ts
index e3e246f7b..8c98aceb0 100644
--- a/src/state/session/util/index.ts
+++ b/src/state/session/util/index.ts
@@ -1,11 +1,12 @@
 import {BSKY_LABELER_DID, BskyAgent} from '@atproto/api'
 import {jwtDecode} from 'jwt-decode'
 
-import {IS_TEST_USER} from '#/lib/constants'
+import {IS_PROD_SERVICE, IS_TEST_USER} from '#/lib/constants'
 import {tryFetchGates} from '#/lib/statsig/statsig'
 import {hasProp} from '#/lib/type-guards'
 import {logger} from '#/logger'
 import * as persisted from '#/state/persisted'
+import {DEFAULT_PROD_FEEDS} from '#/state/queries/preferences'
 import {readLabelers} from '../agent-config'
 import {SessionAccount, SessionApiContext} from '../types'
 
@@ -132,6 +133,7 @@ export async function createAgentAndCreateAccount({
   email,
   password,
   handle,
+  birthDate,
   inviteCode,
   verificationPhone,
   verificationCode,
@@ -167,6 +169,13 @@ export async function createAgentAndCreateAccount({
     })
   }
 
+  // Not awaited so that we can still get into onboarding.
+  // This is OK because we won't let you toggle adult stuff until you set the date.
+  agent.setPersonalDetails({birthDate: birthDate.toISOString()})
+  if (IS_PROD_SERVICE(service)) {
+    agent.setSavedFeeds(DEFAULT_PROD_FEEDS.saved, DEFAULT_PROD_FEEDS.pinned)
+  }
+
   await configureModerationForAccount(agent, account)
 
   return {