mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-04-27 14:57:40 +00:00
fix auth
This commit is contained in:
parent
2fb181dbcb
commit
eb471b0d24
1 changed files with 8 additions and 8 deletions
|
|
@ -109,7 +109,7 @@ end
|
||||||
|
|
||||||
# publish the site
|
# publish the site
|
||||||
post '/publish' do
|
post '/publish' do
|
||||||
unless authenticated?(request['Auth'])
|
unless authenticated?(request.env['HTTP_AUTH'])
|
||||||
status 403
|
status 403
|
||||||
return 'forbidden'
|
return 'forbidden'
|
||||||
end
|
end
|
||||||
|
|
@ -224,7 +224,7 @@ end
|
||||||
|
|
||||||
# make a draft
|
# make a draft
|
||||||
post '/posts/drafts' do
|
post '/posts/drafts' do
|
||||||
unless authenticated?(request['Auth'])
|
unless authenticated?(request.env['HTTP_AUTH'])
|
||||||
status 403
|
status 403
|
||||||
return 'forbidden'
|
return 'forbidden'
|
||||||
end
|
end
|
||||||
|
|
@ -260,7 +260,7 @@ end
|
||||||
|
|
||||||
# update a post
|
# update a post
|
||||||
put '/posts/:year/:month/:id' do |year, month, id|
|
put '/posts/:year/:month/:id' do |year, month, id|
|
||||||
unless authenticated?(request['Auth'])
|
unless authenticated?(request.env['HTTP_AUTH'])
|
||||||
status 403
|
status 403
|
||||||
return 'forbidden'
|
return 'forbidden'
|
||||||
end
|
end
|
||||||
|
|
@ -289,7 +289,7 @@ end
|
||||||
|
|
||||||
# update a draft
|
# update a draft
|
||||||
put '/posts/drafts/:id' do |id|
|
put '/posts/drafts/:id' do |id|
|
||||||
unless authenticated?(request['Auth'])
|
unless authenticated?(request.env['HTTP_AUTH'])
|
||||||
status 403
|
status 403
|
||||||
return 'forbidden'
|
return 'forbidden'
|
||||||
end
|
end
|
||||||
|
|
@ -318,7 +318,7 @@ end
|
||||||
|
|
||||||
# delete a post
|
# delete a post
|
||||||
delete '/posts/:year/:month/:id' do |year, month, id|
|
delete '/posts/:year/:month/:id' do |year, month, id|
|
||||||
unless authenticated?(request['Auth'])
|
unless authenticated?(request.env['HTTP_AUTH'])
|
||||||
status 403
|
status 403
|
||||||
return 'forbidden'
|
return 'forbidden'
|
||||||
end
|
end
|
||||||
|
|
@ -329,7 +329,7 @@ end
|
||||||
|
|
||||||
# delete a draft
|
# delete a draft
|
||||||
delete '/posts/drafts/:id' do |id|
|
delete '/posts/drafts/:id' do |id|
|
||||||
unless authenticated?(request['Auth'])
|
unless authenticated?(request.env['HTTP_AUTH'])
|
||||||
status 403
|
status 403
|
||||||
return 'forbidden'
|
return 'forbidden'
|
||||||
end
|
end
|
||||||
|
|
@ -340,7 +340,7 @@ end
|
||||||
|
|
||||||
# publish a post
|
# publish a post
|
||||||
post '/posts/drafts/:id/publish' do |id|
|
post '/posts/drafts/:id/publish' do |id|
|
||||||
unless authenticated?(request['Auth'])
|
unless authenticated?(request.env['HTTP_AUTH'])
|
||||||
status 403
|
status 403
|
||||||
return 'forbidden'
|
return 'forbidden'
|
||||||
end
|
end
|
||||||
|
|
@ -358,7 +358,7 @@ end
|
||||||
|
|
||||||
# unpublish a post
|
# unpublish a post
|
||||||
post '/posts/:year/:month/:id/unpublish' do |year, month, id|
|
post '/posts/:year/:month/:id/unpublish' do |year, month, id|
|
||||||
unless authenticated?(request['Auth'])
|
unless authenticated?(request.env['HTTP_AUTH'])
|
||||||
status 403
|
status 403
|
||||||
return 'forbidden'
|
return 'forbidden'
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue