This is a little node script that refreshes the access token for the hometime app. It is intended to be run as a cron job.
This little script is necessary because I haven't gotten the Google OAuth
offline app credentials to not expire after 7 days. So for my
calendar-led-strip
project, we're using gcalcli
which requires this
generated oauth
file which is generated via their gcalcli --init
command.
So long story short, this script executes that init command, inserts your
clientId and clientSecret and then opens the browser for you to login with your
Google account. After you login, it saves the generated oauth
file and
optionally copies it to the little server running the hometime
service and
restarting the appropriate systemd service.
- Clone the repository and make a copy of the env vars file
git clone https://github.com/ndom91/hometime-access-refresh && cd hometime-access-refresh
pnpm install
cp .env.example .env.local
- Update the
.env.local
file with your credentials - Run
start
npm script or run it as a cron job
MIT