Don't send Authorization header if we don't have token

This commit is contained in:
Piotr Sarnacki 2015-02-03 09:33:28 +01:00
parent 9c0e02ad51
commit c296a86138

View File

@ -10,8 +10,8 @@ Adapter = DS.ActiveModelAdapter.extend
hash.headers['accept'] = 'application/json; version=2'
token = Travis.sessionStorage.getItem('travis.token')
hash.headers['Authorization'] ||= "token #{token}"
if token = Travis.sessionStorage.getItem('travis.token')
hash.headers['Authorization'] ||= "token #{token}"
hash