Fix ENV variable access in token refresh worker
Add tests for the token refresh worker