Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Token set to Domain=localhost in production

default discord avatar
rene.k3last year

Hi,


the token is being set on

Domain=localhost

instead of my production domain. How do I change that?



Cheers,


René



Found it. For anyone else looking for it.



In your auth collection (usually the users), define the domain as needed:


auth: {
        useAPIKey: true,
        maxLoginAttempts: 10,
        cookies: {
            sameSite: 'none',
            secure: true,
            domain: 'localhost',
        },
    },
    Star on GitHub

    Star

    Chat on Discord

    Discord

    online

    Can't find what you're looking for?

    Get dedicated engineering support directly from the Payload team.