summaryrefslogtreecommitdiff
path: root/src/jet/dependencies/user.ts
diff options
context:
space:
mode:
authorrxliuli <rxliuli@gmail.com>2025-11-04 05:03:50 +0800
committerrxliuli <rxliuli@gmail.com>2025-11-04 05:03:50 +0800
commitbce557cc2dc767628bed6aac87301a1be7c5431b (patch)
treeb51a051228d01fe3306cd7626d4a96768aadb944 /src/jet/dependencies/user.ts
init commit
Diffstat (limited to 'src/jet/dependencies/user.ts')
-rw-r--r--src/jet/dependencies/user.ts30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/jet/dependencies/user.ts b/src/jet/dependencies/user.ts
new file mode 100644
index 0000000..2dad212
--- /dev/null
+++ b/src/jet/dependencies/user.ts
@@ -0,0 +1,30 @@
+/**
+ * Create an "unauthenticated" {@linkcode User} representation
+ *
+ * The property values below match the way that `AppStoreKit` will define the `user`
+ * when the session is not authenticated.
+ */
+export function makeUnauthenticatedUser(): User {
+ return {
+ accountIdentifier: undefined,
+ dsid: undefined,
+ firstName: undefined,
+ // Note: this property is `true` for the native apps but `false` makes
+ // more sense in the context of the "web" client
+ isFitnessAppInstallationAllowed: false,
+ isManagedAppleID: false,
+ isOnDevicePersonalizationEnabled: false,
+ isUnderThirteen: false,
+ katanaId: undefined,
+ lastName: undefined,
+ treatmentGroupIdOverride: undefined,
+ userAgeIfAvailable: undefined,
+
+ onDevicePersonalizationDataContainerForAppIds(appIds) {
+ return {
+ personalizationData: {},
+ metricsData: {},
+ };
+ },
+ };
+}