DiscordAPIError[0]: 401: Unauthorized even though im authorized and the access token is brand new?

I want to get user's @me info with access token, but it says im unauthorized?
    const { REST } = require('@discordjs/rest');
    const { Routes } = require('discord-api-types/v10');
    const rest = new REST({ version: '10', authPrefix:'Bearer' }).setToken(req.cookies.__access_token__);
    
    const info = await rest.get(Routes.user())
Was this page helpful?