accodeing / fortnox-api

Gem that abstracts Fortnox's F3 API
GNU Lesser General Public License v3.0
9 stars 8 forks source link

Format for AccessToken in .env file not working #88

Closed ehannes closed 8 years ago

ehannes commented 8 years ago

To use token rotation, the gem assumes that they are separated with \n. The problem is that when the value is read from the .env-file, it is escaped like this: xxxxxxxxx-yyyyy-zzzz-aaaaa-bbbbbbbbbbbbb\\nxxxxxxxxx-yyyyy-zzzzz-aaaa-bbbbbbbbbbbb Notice the \\n separating the two tokens.

We did not get this problem when running our tests because the values from our .env-file are never used in our tests. Instead, we have a shared context for repositories that sets the environment variables and our spec_helper resets these values after each test run. We should remove this and use our .env-file instead since current approach is error prone.