From c600621cac115113af770b535fd000191ec11229 Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Tue, 8 Oct 2024 15:32:03 +0200 Subject: [PATCH] remoived accestoken --- lib/pangea/models/base_subscription_info.dart | 8 ++++---- lib/pangea/models/mobile_subscriptions.dart | 5 ++--- lib/pangea/models/web_subscriptions.dart | 5 ++--- lib/pangea/repo/subscription_repo.dart | 8 ++------ 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/lib/pangea/models/base_subscription_info.dart b/lib/pangea/models/base_subscription_info.dart index 8792284e6..469ac5786 100644 --- a/lib/pangea/models/base_subscription_info.dart +++ b/lib/pangea/models/base_subscription_info.dart @@ -36,14 +36,14 @@ class SubscriptionInfo { Fetch App Ids for each RC app (iOS, Android, and Stripe). Used to determine which app a user with an active subscription purchased that subscription. */ - Future setAppIds(String accessToken) async { + Future setAppIds() async { if (appIds != null) return; - appIds = await SubscriptionRepo.getAppIds(accessToken); + appIds = await SubscriptionRepo.getAppIds(); } - Future setAllProducts(String accessToken) async { + Future setAllProducts() async { if (allProducts != null) return; - allProducts = await SubscriptionRepo.getAllProducts(accessToken); + allProducts = await SubscriptionRepo.getAllProducts(); } bool get isNewUserTrial => diff --git a/lib/pangea/models/mobile_subscriptions.dart b/lib/pangea/models/mobile_subscriptions.dart index 917deebb6..00fc6e3fd 100644 --- a/lib/pangea/models/mobile_subscriptions.dart +++ b/lib/pangea/models/mobile_subscriptions.dart @@ -31,9 +31,8 @@ class MobileSubscriptionInfo extends SubscriptionInfo { ); return; } - final accessToken = super.pangeaController.userController.accessToken; - await setAppIds(accessToken); - await setAllProducts(accessToken); + await setAppIds(); + await setAllProducts(); await setCustomerInfo(); await setMobilePackages(); if (allProducts != null && appIds != null) { diff --git a/lib/pangea/models/web_subscriptions.dart b/lib/pangea/models/web_subscriptions.dart index 92a3e4dd5..1a6cc722a 100644 --- a/lib/pangea/models/web_subscriptions.dart +++ b/lib/pangea/models/web_subscriptions.dart @@ -8,9 +8,8 @@ class WebSubscriptionInfo extends SubscriptionInfo { @override Future configure() async { - final accessToken = super.pangeaController.userController.accessToken; - await setAppIds(accessToken); - await setAllProducts(accessToken); + await setAppIds(); + await setAllProducts(); await setCustomerInfo(); if (allProducts == null || appIds == null) { diff --git a/lib/pangea/repo/subscription_repo.dart b/lib/pangea/repo/subscription_repo.dart index 4c30a0c0e..d5b8ae4c7 100644 --- a/lib/pangea/repo/subscription_repo.dart +++ b/lib/pangea/repo/subscription_repo.dart @@ -13,11 +13,10 @@ import 'package:http/http.dart' as http; import '../network/urls.dart'; class SubscriptionRepo { - static Future getAppIds(String accessToken) async { + static Future getAppIds() async { try { final Requests req = Requests( choreoApiKey: Environment.choreoApiKey, - matrixAccessToken: accessToken, ); final http.Response res = await req.get( url: PApiUrls.rcAppsChoreo, @@ -35,13 +34,10 @@ class SubscriptionRepo { } } - static Future?> getAllProducts( - String accessToken, - ) async { + static Future?> getAllProducts() async { try { final Requests req = Requests( choreoApiKey: Environment.choreoApiKey, - matrixAccessToken: accessToken, ); final http.Response res = await req.get( url: PApiUrls.rcProductsChoreo,