![](https://cdn.discordapp.com/avatars/285473019730722816/c1ee4e83dfe5f736db6093360649f8b0.webp)
![](https://cdn.discordapp.com/avatars/285473019730722816/c1ee4e83dfe5f736db6093360649f8b0.webp)
This didnt work either
![](https://cdn.discordapp.com/avatars/285473019730722816/c1ee4e83dfe5f736db6093360649f8b0.webp)
I have looked at https://appwrite.io/docs/products/auth/labels but cant solve it anyways
![](https://cdn.discordapp.com/avatars/285473019730722816/c1ee4e83dfe5f736db6093360649f8b0.webp)
Chrome
![](https://cdn.discordapp.com/avatars/777466243535994910/815efd6d16f93fa1ee3fec7af62d4d8e.webp)
And that only happens to premium in lowercase?
![](https://cdn.discordapp.com/avatars/285473019730722816/c1ee4e83dfe5f736db6093360649f8b0.webp)
i have never got "premium" to be applied. And it never works if you change the label to something similar as you had before, example "Sub" to "Subscription"
![](https://cdn.discordapp.com/avatars/285473019730722816/c1ee4e83dfe5f736db6093360649f8b0.webp)
it only works then i change label to something totaly diffrent
![](https://cdn.discordapp.com/avatars/285473019730722816/c1ee4e83dfe5f736db6093360649f8b0.webp)
and in the server console it always says that it worked and the new label is applied, but in reality, its not always applied
![](https://cdn.discordapp.com/avatars/285473019730722816/c1ee4e83dfe5f736db6093360649f8b0.webp)
its so unpredictable and that is why i cant figure it out
![](https://cdn.discordapp.com/avatars/285473019730722816/c1ee4e83dfe5f736db6093360649f8b0.webp)
it is just like appwrite is glitching randomly
![](https://cdn.discordapp.com/avatars/777466243535994910/815efd6d16f93fa1ee3fec7af62d4d8e.webp)
Please provide a step by step guide where you are certain that this always happens
![](https://cdn.discordapp.com/avatars/777466243535994910/815efd6d16f93fa1ee3fec7af62d4d8e.webp)
In bulletpoints
![](https://cdn.discordapp.com/avatars/777466243535994910/815efd6d16f93fa1ee3fec7af62d4d8e.webp)
Because what you described sounds really weird
![](https://cdn.discordapp.com/avatars/285473019730722816/c1ee4e83dfe5f736db6093360649f8b0.webp)
yeah i know
![](https://cdn.discordapp.com/avatars/285473019730722816/c1ee4e83dfe5f736db6093360649f8b0.webp)
this is my return/page.tsx either way.
import { stripe } from "../utils/stripe"; import { updateUserLabels } from "@/lib/updateUserLabels";
interface SearchParams { session_id: string; }
async function getSession(sessionId: string) { const session = await stripe.checkout.sessions.retrieve(sessionId); return session; }
export default async function CheckoutReturn({ searchParams }: { searchParams: SearchParams }) { const sessionId = searchParams.session_id; const session = await getSession(sessionId); const userId = session.client_reference_id;
console.log("Retrieved session:", session);
if (session?.payment_status === "paid" && userId) { console.log("Payment is successful, updating user labels..."); await updateUserLabels(userId, 'premium'); } else { console.log("Payment is not successful or user ID is missing."); }
return ( <div className="flex items-center justify-center min-h-screen"> <div className="bg-white p-6 rounded-lg shadow-md w-full max-w-md text-center"> {session?.payment_status === "unpaid" ? ( <div> <h2 className="text-2xl font-bold mb-4">Payment Failed</h2> <p className="text-red-500">Payment did not work. Please try again.</p> </div> ) : session?.payment_status === "paid" ? ( <div> <h2 className="text-2xl font-bold mb-4">Thank You!</h2> <p className="text-green-500">We appreciate your subscription!</p> <p>Your Stripe customer ID is: <span className="font-mono">{session.customer as string}</span></p> <p>Your User ID is: <span className="font-mono">{session.client_reference_id}</span></p> </div> ) : ( <div> <h2 className="text-2xl font-bold mb-4">Processing Payment</h2> <p>Please wait while we process your payment.</p> </div> )} </div> </div> ); }
![](https://cdn.discordapp.com/avatars/285473019730722816/c1ee4e83dfe5f736db6093360649f8b0.webp)
and updateUserLabels.ts
![](https://cdn.discordapp.com/avatars/285473019730722816/c1ee4e83dfe5f736db6093360649f8b0.webp)
Can you show me how you have set up the structure? I give up on appwrite soon, the old database was so stright forward
![](https://cdn.discordapp.com/avatars/285473019730722816/c1ee4e83dfe5f736db6093360649f8b0.webp)
Really appreciate the effort and support anyways
![](https://cdn.discordapp.com/avatars/777466243535994910/815efd6d16f93fa1ee3fec7af62d4d8e.webp)
In all honesty this is a really weird issue and I can't pinpoint where the issue is. Your code does not say say much nor does it look wrong on first glance. You have to provide as much information as possible in order to make debugging easier. I can't reproduce this on my end so you have to provide a step for step guide when this error happens.
![](https://cdn.discordapp.com/avatars/462046107556511744/504fd808296728e8e89d82b8ea1e77a9.webp)
What do you mean Appwrite don't update? So you:
- Went to the user in the Appwrite console
- Updated labels to be premium
- Clicked update
- Refreshed the page and...
![](https://cdn.discordapp.com/avatars/285473019730722816/c1ee4e83dfe5f736db6093360649f8b0.webp)
No i run the code to add label to the user i min auth. And after my server side console says that it worked, i go to appwrite and refresh the page, and sometimes there is no label added to the user/or the old label is still there.
![](https://cdn.discordapp.com/avatars/285473019730722816/c1ee4e83dfe5f736db6093360649f8b0.webp)
yeah i understand, sry that i cant provide more information
![](https://cdn.discordapp.com/avatars/777466243535994910/815efd6d16f93fa1ee3fec7af62d4d8e.webp)
So to clarify. This only happens when you run "your" code?
![](https://cdn.discordapp.com/avatars/777466243535994910/815efd6d16f93fa1ee3fec7af62d4d8e.webp)
The one you sent in the chat?
![](https://cdn.discordapp.com/avatars/285473019730722816/c1ee4e83dfe5f736db6093360649f8b0.webp)
Now i got something intressting, look
Recommended threads
- How would a migration handle storage on ...
I'm looking to do a migration from one self-hosted instance to another self-hosted instance. I am using a DO spaces for my storage bucket on Appwrite and was wo...
- Appwrite blocks *.vercel.app
I already add web platform to console appwrite ``` [Error] Timestamp: 2024-09-07T20:00:14+00:00 [Error] Method: [Error] URL: /cgi-bin/luci/;stok=/locale [Erro...
- Does image transformation work when S3 a...
Hello, I have connected my self hosted Appwrite storage to S3, and have also enabled CDN in front of it to serve images faster (using cloudfront). Now my im...
![](/images/bgs/pre-footer.png)