🐛 Allow expired Plus users to access billing portal for renewal#840
🐛 Allow expired Plus users to access billing portal for renewal#840williamchong merged 1 commit intolikecoin:developfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enables lapsed/expired Plus subscribers to access the Stripe billing portal for renewal by introducing an isExpiredLikerPlus flag and using it to expose a “Renew Subscription” path in the account UI.
Changes:
- Add
isExpiredLikerPlusto shared API response typing and Nuxt auth session typing. - Populate
isExpiredLikerPlusinto the user session during login/register and session refresh. - Update the account page to show a Renew button + “Expired” membership state label, and add i18n strings.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| types/nuxt-auth-utils.d.ts | Extends session User typing with isExpiredLikerPlus. |
| shared/types/api.d.ts | Extends liker API typing with isExpiredLikerPlus. |
| server/api/register.post.ts | Writes isExpiredLikerPlus into the session on registration. |
| server/api/login.post.ts | Writes isExpiredLikerPlus into the session on login. |
| server/api/account/refresh.post.ts | Writes isExpiredLikerPlus into the session on refresh. |
| pages/account/index.vue | Shows renew/manage subscription UI for expired/active users; adds “Expired” state label; updates click gating. |
| i18n/locales/zh-Hant.json | Adds strings for renew + expired state. |
| i18n/locales/en.json | Adds strings for renew + expired state. |
| composables/use-subscription.ts | Exposes isExpiredLikerPlus computed from the session. |
You can also share your feedback on Copilot code review. Take the survey.
| <template | ||
| v-if="!isApp && user?.isLikerPlus" | ||
| v-if="!isApp && (user?.isLikerPlus || user?.isExpiredLikerPlus)" | ||
| #right | ||
| > | ||
| <UButton | ||
| :label="user?.isLikerPlus ? $t('account_page_manage_subscription') : $t('account_page_upgrade_to_plus')" | ||
| :label="user?.isLikerPlus ? $t('account_page_manage_subscription') : $t('account_page_renew_subscription')" | ||
| :variant="user?.isLikerPlus ? 'outline' : 'solid'" |
| const isExpiredLikerPlus = computed(() => { | ||
| if (!hasLoggedIn.value) return false | ||
| return user.value?.isExpiredLikerPlus ?? false | ||
| }) |
0ed1efc to
a599b68
Compare
There was a problem hiding this comment.
Pull request overview
This PR enables lapsed (expired/retrying) Plus subscribers to access the Stripe billing portal by introducing an isExpiredLikerPlus flag and updating the account UI to show a “Renew Subscription” button for those users.
Changes:
- Add
isExpiredLikerPlusto API/session/user typings and persist it into the user session on login/register/refresh. - Update Account page subscription section to show “Renew Subscription” for expired Plus users and display an “Expired” membership state.
- Expose
isExpiredLikerPlusviauseSubscription()for broader UI consumption.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| types/nuxt-auth-utils.d.ts | Extends session User type with isExpiredLikerPlus. |
| shared/types/api.d.ts | Extends LikeCoin API response typing with isExpiredLikerPlus. |
| server/api/register.post.ts | Stores isExpiredLikerPlus into session at registration. |
| server/api/login.post.ts | Stores isExpiredLikerPlus into session at login. |
| server/api/account/refresh.post.ts | Refreshes session with isExpiredLikerPlus from profile info. |
| pages/account/index.vue | Shows renew/manage subscription CTA and “Expired” label; triggers session refresh on login. |
| i18n/locales/zh-Hant.json | Adds translations for “Renew Subscription” and “Expired”. |
| i18n/locales/en.json | Adds translations for “Renew Subscription” and “Expired”. |
| composables/use-subscription.ts | Adds isExpiredLikerPlus computed and normalizes boolean returns. |
You can also share your feedback on Copilot code review. Take the survey.
| if (!user.value?.isLikerPlus) { | ||
| callOnce('account-refresh-session', () => accountStore.refreshSessionInfo()) |
Expired/retrying subscribers could not reach the Stripe billing portal because the button was gated on isLikerPlus (active only). Add isExpiredLikerPlus flag from API through session to show a "Renew Subscription" button for lapsed members.
a599b68 to
81650f2
Compare
Expired/retrying subscribers could not reach the Stripe billing portal because the button was gated on isLikerPlus (active only). Add isExpiredLikerPlus flag from API through session to show a "Renew Subscription" button for lapsed members.