Don't check scopes for Travis Become

This commit is contained in:
Piotr Sarnacki 2015-06-16 15:25:21 +02:00
parent 1c9dbed4df
commit 4115a7c59b
2 changed files with 8 additions and 2 deletions

View File

@ -52,11 +52,16 @@ Auth = Ember.Object.extend
null
validateUser: (user) ->
fieldsToValidate = ['id', 'login', 'token', 'correct_scopes']
fieldsToValidate = ['id', 'login', 'token']
isTravisBecome = sessionStorage.getItem('travis.become')
unless isTravisBecome
fieldsToValidate.push 'correct_scopes'
if config.pro
fieldsToValidate.push 'channels'
fieldsToValidate.every( (field) => @validateHas(field, user) ) && user.correct_scopes
fieldsToValidate.every( (field) => @validateHas(field, user) ) && (isTravisBecome || user.correct_scopes)
validateHas: (field, user) ->
if user[field]

View File

@ -33,5 +33,6 @@ __END__
var storage = %s;
storage.setItem('travis.token', %p);
storage.setItem('travis.user', %p);
storage.setItem('travis.become', true);
window.location = %p;
</script>