Skip to content

Unable to set/use token due to confusing errors #7

@Methodician

Description

@Methodician

Every time I try to run figcd auth (even if I pass a cookie arg) I get the following in sequence:

First:

Email and password authentication seems to work

Second:

Cookie argument missing, automatically retrieving fresh session cookies to start authentication
FIGMA_COOKIE='lots of stuff'; FIGMA_TSID=s0m3c0d3

Third:

Trying 2FA seems to work but I get the following two error blocks before it exits"

{"error":true,"status":400,"message":"Please enter your authenticator code","i18n":{"id":"auth.error.enter-two-factor-code","fallback_text":"Please enter your authenticator code","params":{}},"reason":{"missing":"two_factor","sms":true,"phone_number":"4648"}}
/Users/myName/.nvm/versions/node/v20.11.0/lib/node_modules/figcd/src/auth-helper.js:126
throw new Error("Authn cookie not found");
^

Error: Authn cookie not found
at Command.authenticate (/Users/myName/.nvm/versions/node/v20.11.0/lib/node_modules/figcd/src/auth-helper.js:126:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Command.parseAsync (/Users/myName/.nvm/versions/node/v20.11.0/lib/node_modules/figcd/node_modules/commander/lib/command.js:936:5)
at async main (/Users/myName/.nvm/versions/node/v20.11.0/lib/node_modules/figcd/bin/cli.js:223:9)

It's hard to know what to make of this because at first it looks like it's saying there was a problem with two-factor authentication (odd, because it's working elsewhere) but then it's talking about the Authn cookie (odd, because it claims it's resolving that, even if I provide one). I tried a lot of different approaches, but this is always what I get.

Lastly / Alternatively

if I simply generate an authentication token through the Figma UI and provide it as the argument, it looks like the program has concluded my token is expires? It's definitely not.

Command: figcd prepare -t figd_my-token-asdf1235asdf1235 -m dist/manifest.json
Output:

/Users/myname/.nvm/versions/node/v20.11.0/lib/node_modules/figcd/src/figma-helper.js:145
throw new Error('The provided token seem to be no longer valid.');
^

Error: The provided token seem to be no longer valid.
at getPluginInfo (/Users/myname/.nvm/versions/node/v20.11.0/lib/node_modules/figcd/src/figma-helper.js:145:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Command. (/Users/myname/.nvm/versions/node/v20.11.0/lib/node_modules/figcd/bin/cli.js:101:43)
at async Command.parseAsync (/Users/myname/.nvm/versions/node/v20.11.0/lib/node_modules/figcd/node_modules/commander/lib/command.js:936:5)
at async main (/Users/myname/.nvm/versions/node/v20.11.0/lib/node_modules/figcd/bin/cli.js:223:9)

Node.js v20.11.0

Is this project still viable? Do I need to do something differently?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions