-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: cancel subscription #159
Conversation
@Ipriyankrajai is attempting to deploy a commit to the Inbox Zero Team on Vercel. A member of the Team first needs to authorize it. |
apps/web/utils/actions.ts
Outdated
@@ -106,6 +125,9 @@ export async function deleteAccountAction() { | |||
captureException(error); | |||
} | |||
|
|||
if (lemonSqueezySubscriptionItemId) | |||
await cancelSubScriptionForUser(lemonSqueezySubscriptionItemId); | |||
|
|||
await prisma.user.delete({ where: { email: session.user.email } }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should delete the user after the subscription tenure is ended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, don't delete the user. "leaving a user's data in Stripe after they delete their account is generally allowed under GDPR, provided that you have a legitimate reason for retaining this data, such as for financial records, compliance with tax law, or other regulatory requirements."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now i have commented that part
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge conflict too :(
apps/web/utils/actions.ts
Outdated
@@ -106,6 +125,9 @@ export async function deleteAccountAction() { | |||
captureException(error); | |||
} | |||
|
|||
if (lemonSqueezySubscriptionItemId) | |||
await cancelSubScriptionForUser(lemonSqueezySubscriptionItemId); | |||
|
|||
await prisma.user.delete({ where: { email: session.user.email } }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, don't delete the user. "leaving a user's data in Stripe after they delete their account is generally allowed under GDPR, provided that you have a legitimate reason for retaining this data, such as for financial records, compliance with tax law, or other regulatory requirements."
id: true, | ||
tier: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need id
or tier
here, right?
if (lemonSqueezySubscriptionId) | ||
await cancelSubScriptionForUser(lemonSqueezySubscriptionId); | ||
|
||
// await prisma.user.delete({ where: { email: session.user.email } }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uncomment. We do want to delete the user.
(We do want to keep the user in Lemon though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left 2 comments
fixes: #153