Reputation: 1324
Snyk asks for authentication when user uses it on first time. It looks like this:
snyk auth
in cmd.1 - 3 is obvious for me how it works. But I don't understand how node knows that I have logged in. It has something to do with HTTP headers I guess but still I have no idea how it should look like in a code. I have tried to find my answer in cli/commands/auth.js but code is too complicated to me.
Upvotes: 2
Views: 395
Reputation: 2597
You can create a temporary http server with a callback route for authentication; just like you do in a simple ordinary web application.
After the authentication, you can save the received information (e.g. in a file) and stop the http server.
Upvotes: 4