Token set to Domain=localhost in production

default discord avatar
rene.k3
2 months ago

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',
        },
    },
    Open the post
    Continue the discussion in Discord
    Like what we're doing?
    Star us on GitHub!

    Star

    Connect with the Payload Community on Discord

    Discord

    online

    Can't find what you're looking for?

    Get help straight from the Payload team with an Enterprise License.