add isOwner to the client settings so we can check if the user is the owner
This commit is contained in:
parent
71cd00b86a
commit
ed5061e9e5
|
@ -173,7 +173,16 @@ setup = (user) ->
|
|||
switch document.cookie.match('(?:^|;)\\s?state=(.*?)(?:;|$)')[1]
|
||||
when 'loggedIn' then window.isAuthenticated = true
|
||||
when 'loggedOut' then window.isAuthenticated = false
|
||||
update_footer ownerName, isAuthenticated
|
||||
myInit = {
|
||||
method: 'GET'
|
||||
cache: 'no-cache'
|
||||
mode: 'same-origin'
|
||||
}
|
||||
fetch '/auth/client-settings.json', myInit
|
||||
.then (response) ->
|
||||
response.json().then (json) ->
|
||||
window.isOwner = json.isOwner
|
||||
update_footer ownerName, isAuthenticated
|
||||
lastCookie = currentCookie
|
||||
, 100
|
||||
|
||||
|
|
|
@ -306,6 +306,10 @@ module.exports = exports = (log, loga, argv) ->
|
|||
}
|
||||
if wikiHost
|
||||
settings.wikiHost = wikiHost
|
||||
if isAuthorized(req) and owner isnt ''
|
||||
settings.isOwner = true
|
||||
else
|
||||
settings.isOwner = false
|
||||
res.json settings
|
||||
|
||||
app.get '/auth/loginDialog', (req, res) ->
|
||||
|
|
Loading…
Reference in New Issue