DEV Community

Discussion on: Automate Home Lights With The Fetch API

delfick profile image
Stephen Moore

I'm not sure why your token wouldn't work as a Bearer token. If you get your token, can you do something like this from the command line?

curl -H"Authorization: Bearer c6805af2e4fa8cd15dc28a8c6e54cc1c371e9efafb87b10536341105f74087a3"

(in this example, that's not a real token, but it looks like one :p)

The token you create from never expires. The only way they stop working is if you revoke them from that same page.

I look forward to reading your other articles :)

Thread Thread
mtliendo profile image
Michael Liendo Author

Thanks so much, I got it to work with a Bearer token!

With Basic auth, it's token:, but I didn't need the colon for Bearer auth.

Thanks again, that definitely remotes some overhead!

Thread Thread
delfick profile image
Stephen Moore

Awesome! :)