Skip to content

Commit

Permalink
feat: hardcode token expiration as zero at start
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Gleich <[email protected]>
  • Loading branch information
gleich committed Oct 22, 2024
1 parent cd7db9f commit 51eccf9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion internal/apis/strava/tokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func loadTokens() tokens {
return tokens{
Access: secrets.SECRETS.StravaAccessToken,
Refresh: secrets.SECRETS.StravaRefreshToken,
ExpiresAt: secrets.SECRETS.StravaRefreshTokenExpiration,
ExpiresAt: 0, // starts at zero to force a refresh on boot
}
}

Expand Down
23 changes: 11 additions & 12 deletions internal/secrets/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@ type SecretsData struct {
CacheFolder string `env:"CACHE_FOLDER"`
ValidToken string `env:"VALID_TOKEN"`

StravaClientID string `env:"STRAVA_CLIENT_ID"`
StravaClientSecret string `env:"STRAVA_CLIENT_SECRET"`
StravaOAuthCode string `env:"STRAVA_OAUTH_CODE"`
StravaAccessToken string `env:"STRAVA_ACCESS_TOKEN"`
StravaRefreshToken string `env:"STRAVA_REFRESH_TOKEN"`
StravaRefreshTokenExpiration int64 `env:"STRAVA_REFRESH_TOKEN_EXPIRATION"`
StravaSubscriptionID int64 `env:"STRAVA_SUBSCRIPTION_ID"`
StravaVerifyToken string `env:"STRAVA_VERIFY_TOKEN"`
MapboxAccessToken string `env:"MAPBOX_ACCESS_TOKEN"`
MinioEndpoint string `env:"MINIO_ENDPOINT"`
MinioAccessKeyID string `env:"MINIO_ACCESS_KEY_ID"`
MinioSecretKey string `env:"MINIO_SECRET_KEY"`
StravaClientID string `env:"STRAVA_CLIENT_ID"`
StravaClientSecret string `env:"STRAVA_CLIENT_SECRET"`
StravaOAuthCode string `env:"STRAVA_OAUTH_CODE"`
StravaAccessToken string `env:"STRAVA_ACCESS_TOKEN"`
StravaRefreshToken string `env:"STRAVA_REFRESH_TOKEN"`
StravaSubscriptionID int64 `env:"STRAVA_SUBSCRIPTION_ID"`
StravaVerifyToken string `env:"STRAVA_VERIFY_TOKEN"`
MapboxAccessToken string `env:"MAPBOX_ACCESS_TOKEN"`
MinioEndpoint string `env:"MINIO_ENDPOINT"`
MinioAccessKeyID string `env:"MINIO_ACCESS_KEY_ID"`
MinioSecretKey string `env:"MINIO_SECRET_KEY"`

SteamKey string `env:"STEAM_KEY"`
SteamID string `env:"STEAM_ID"`
Expand Down

0 comments on commit 51eccf9

Please sign in to comment.