Skip to content

Commit

Permalink
Comment summarizing the reason for the fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosNihelton committed Oct 18, 2023
1 parent 611a13f commit e1511e6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions storeapi/base/impl/StoreContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ std::string StoreContext::GenerateUserJwt(std::string token,
auto hUserId = winrt::to_hstring(userId);
auto hJwt = self.GetCustomerPurchaseIdAsync(hToken, hUserId).get();
if (hJwt.empty()) {
// Although the preferred API for the MS Store is the one exported in the
// `Windows::Services::Store` namespace, it has consistently and silently
// failed to generate the user JWT, producing just an empty string. The old
// (deprecated) `Windows::ApplicationModel::Store` namespace, on the other
// hand, succeeded consistently in my tests, as long as the app is deployed
// (throwing exceptions otherwise).
hJwt = winrt::Windows::ApplicationModel::Store::CurrentApp::
GetCustomerPurchaseIdAsync(hToken, hUserId)
.get();
Expand Down

0 comments on commit e1511e6

Please sign in to comment.