Don't check scopes for Travis Become
This commit is contained in:
parent
1c9dbed4df
commit
4115a7c59b
|
@ -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]
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue
Block a user