authenticate owner request for realz

This commit is contained in:
Lisa P 2015-08-26 11:11:12 -04:00
parent 47d8951535
commit d6fa74c8f6
3 changed files with 13 additions and 11 deletions

View File

@ -9,14 +9,11 @@ Route = TravisRoute.extend
@controllerFor('loading').set('layoutName', null)
model: (params) ->
if @get('auth.signedIn')
$.get(config.apiEndpoint + "/v3/owner/#{params.owner}", {
headers: {
Authorization: "token #{@auth.token()}"
}
})
else
$.get(config.apiEndpoint + "/v3/owner/#{params.owner}")
$.ajax(config.apiEndpoint + "/v3/owner/#{params.owner}", {
headers: {
Authorization: "token #{@auth.token()}"
}
})
beforeModel: ->
@controllerFor('loading').set('layoutName', 'simple')

View File

@ -10,6 +10,11 @@ Route = TravisRoute.extend
"#{model.name}"
model: (params, transition) ->
$.get(config.apiEndpoint + "/v3/owner/#{transition.params.owner.owner}?include=user.repositories,organization.repositories,build.commit,repository.active")
$.ajax(config.apiEndpoint + "/v3/owner/#{transition.params.owner.owner}?include=user.repositories,organization.repositories,build.commit,repository.active", {
headers: {
Authorization: "token #{@auth.token()}"
},
type: "GET"
})
`export default Route`

View File

@ -1,6 +1,6 @@
{{#if repo.private }}
{{!-- {{#if repo.private }}
<div class="tile-lock"><span class="icon icon-lock"></span></div>
{{/if}}
{{/if}} --}}
<div class="repo">
{{#if isAnimating}}
<span class="icon-owner-receiving"><i></i><i></i><i></i></span>