[pro-merge] Add travis-pro auth extensions

This commit is contained in:
Piotr Sarnacki 2014-12-29 15:53:59 +01:00
parent 0fc0d0eb03
commit 2c05af6588

View File

@ -46,7 +46,11 @@ window.Auth = Ember.Object.extend
null
validateUser: (user) ->
@validateHas('id', user) && @validateHas('login', user) && @validateHas('token', user) && @validateHas('correct_scopes', user) && user.correct_scopes
fieldsToValidate = ['id', 'login', 'token', 'correct_scopes']
if Travis.config.pro
fieldsToValidate.push 'channels'
fieldsToValidate.every( (field) => @validateHas(field, user) ) && user.correct_scopes
validateHas: (field, user) ->
if user[field]