fix(SW-236): properly handle expired token in webviews
Trying out a new pattern for errors in data fetching. Next.js is not a fan of throwing errors. Instead it recommends returning different shapes for each state. Ref: https://nextjs.org/docs/app/building-your-application/routing/error-handling#handling-expected-errors-from-server-components It requires some more detailing and a bit more refactoring in non webview part, but it is a start. This webview specific implementation should not break web.
This commit is contained in:
@@ -24,7 +24,7 @@ export default async function CurrentBenefitsBlock({
|
||||
// TAKE NOTE: we need clarification on how benefits stack from different levels
|
||||
// in order to determine if a benefit is specific to a level or if it is a cumulative benefit
|
||||
// we might have to add a new boolean property "exclusive" or similar
|
||||
if (!user) {
|
||||
if (!user || "error" in user) {
|
||||
return null
|
||||
}
|
||||
const membership = getMembership(user.memberships)
|
||||
|
||||
Reference in New Issue
Block a user