Skip to content

🐛 Allow expired Plus users to access billing portal for renewal#840

Merged
williamchong merged 1 commit intolikecoin:developfrom
williamchong:feature/plus
Mar 18, 2026
Merged

🐛 Allow expired Plus users to access billing portal for renewal#840
williamchong merged 1 commit intolikecoin:developfrom
williamchong:feature/plus

Conversation

@williamchong
Copy link
Copy Markdown
Member

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.

@williamchong williamchong requested review from a team, AuroraHuang22, Copilot and nwingt March 17, 2026 16:24
@williamchong williamchong marked this pull request as ready for review March 17, 2026 16:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 isExpiredLikerPlus to shared API response typing and Nuxt auth session typing.
  • Populate isExpiredLikerPlus into 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.

Comment thread pages/account/index.vue
Comment on lines 17 to 23
<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'"
Comment on lines +19 to +22
const isExpiredLikerPlus = computed(() => {
if (!hasLoggedIn.value) return false
return user.value?.isExpiredLikerPlus ?? false
})
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 isExpiredLikerPlus to 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 isExpiredLikerPlus via useSubscription() 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.

Comment thread pages/account/index.vue Outdated
Comment on lines +603 to +604
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.
@williamchong williamchong merged commit d0834b9 into likecoin:develop Mar 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants