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

Ben/dev 464 - Free allotment for New Users #169

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

bLopata
Copy link
Contributor

@bLopata bLopata commented Nov 11, 2024

Adds header for unsubscribed users showing the current message count. Sets up a trial membership valid for 1 year when the user loads the page. Decrements using protected server/admin method hooking to prevent injection attacks.

image

Trial subscription metadata 👇
https://app.screencast.com/rpJGmIWHW7Ori

Copy link

vercel bot commented Nov 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tutor-gpt ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 15, 2024 6:27pm

Copy link
Collaborator

@VVoruganti VVoruganti left a comment

Choose a reason for hiding this comment

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

You also need to change the api/ folder to check for valid subscription or a remaining trial.

Should be in the /api/security file

@bLopata
Copy link
Contributor Author

bLopata commented Nov 15, 2024

You also need to change the api/ folder to check for valid subscription or a remaining trial.

Should be in the /api/security file

Good call. Thinking something like this:
sub = ( supabase.table("subscriptions") .select("*") .eq("user_id", user.id) .or_( "status.eq.active," # Active subscriptions "and(status.eq.trialing,trial_end.gte.now())" # Valid trial subscriptions ) .execute() )

unless you think we should have this call check the freeMessage allotment as well? Didn't know if that would be too tightly coupled.

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