stripe subscription list 401

When I try to list the active subscriptions I get and 401 error. Tried using the doc example.

Any idea?

    import { authClient } from '$lib/auth/client';

    async function isPremium() {
        const subscriptions = await authClient.subscription.list();
        // const activeSubscription = subscriptions.find(
        //     (sub) => sub.status === 'active' || sub.status === 'trialing'
        // );
        console.log(subscriptions);
    }
    isPremium();

{ data: null, error: { status: 401, statusText: 'Unauthorized' } }
Solution
it suddenly worked after some restarts, i dont know how
Was this page helpful?