Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

Ipriyankrajai
Copy link
Contributor

fixes: #153

Copy link

vercel bot commented Mar 6, 2024

@Ipriyankrajai is attempting to deploy a commit to the Inbox Zero Team on Vercel.

A member of the Team first needs to authorize it.

@@ -106,6 +125,9 @@ export async function deleteAccountAction() {
captureException(error);
}

if (lemonSqueezySubscriptionItemId)
await cancelSubScriptionForUser(lemonSqueezySubscriptionItemId);

await prisma.user.delete({ where: { email: session.user.email } });
Copy link
Contributor Author

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.

Copy link
Owner

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."

Copy link
Contributor Author

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

Copy link
Owner

@elie222 elie222 left a 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 Show resolved Hide resolved
@@ -106,6 +125,9 @@ export async function deleteAccountAction() {
captureException(error);
}

if (lemonSqueezySubscriptionItemId)
await cancelSubScriptionForUser(lemonSqueezySubscriptionItemId);

await prisma.user.delete({ where: { email: session.user.email } });
Copy link
Owner

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."

Comment on lines +101 to +102
id: true,
tier: true,
Copy link
Owner

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 } });
Copy link
Owner

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)

Copy link
Owner

@elie222 elie222 left a comment

Choose a reason for hiding this comment

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

Left 2 comments

@elie222 elie222 closed this May 13, 2024
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.

Cancel Lemon Squeezy subscription when a user deletes their account
2 participants