check if user is signed in
This commit is contained in:
parent
d6fa74c8f6
commit
978b35b6ca
|
@ -9,11 +9,10 @@ Route = TravisRoute.extend
|
||||||
@controllerFor('loading').set('layoutName', null)
|
@controllerFor('loading').set('layoutName', null)
|
||||||
|
|
||||||
model: (params) ->
|
model: (params) ->
|
||||||
$.ajax(config.apiEndpoint + "/v3/owner/#{params.owner}", {
|
options = {}
|
||||||
headers: {
|
if @get('auth.signedIn')
|
||||||
Authorization: "token #{@auth.token()}"
|
options.headers = { Authorization: "token #{@auth.token()}" }
|
||||||
}
|
$.ajax(config.apiEndpoint + "/v3/owner/#{params.owner}", options)
|
||||||
})
|
|
||||||
|
|
||||||
beforeModel: ->
|
beforeModel: ->
|
||||||
@controllerFor('loading').set('layoutName', 'simple')
|
@controllerFor('loading').set('layoutName', 'simple')
|
||||||
|
|
|
@ -10,11 +10,9 @@ Route = TravisRoute.extend
|
||||||
"#{model.name}"
|
"#{model.name}"
|
||||||
|
|
||||||
model: (params, transition) ->
|
model: (params, transition) ->
|
||||||
$.ajax(config.apiEndpoint + "/v3/owner/#{transition.params.owner.owner}?include=user.repositories,organization.repositories,build.commit,repository.active", {
|
options = {}
|
||||||
headers: {
|
if @get('auth.signedIn')
|
||||||
Authorization: "token #{@auth.token()}"
|
options.headers = { Authorization: "token #{@auth.token()}" }
|
||||||
},
|
$.ajax(config.apiEndpoint + "/v3/owner/#{transition.params.owner.owner}?include=user.repositories,organization.repositories,build.commit,repository.active", options)
|
||||||
type: "GET"
|
|
||||||
})
|
|
||||||
|
|
||||||
`export default Route`
|
`export default Route`
|
||||||
|
|
Loading…
Reference in New Issue
Block a user