forked from forgejo/forgejo
refactor API routes and some work for #976
This commit is contained in:
parent
e0bae9547a
commit
56dd430a10
17 changed files with 374 additions and 377 deletions
|
@ -130,22 +130,3 @@ func Toggle(options *ToggleOptions) macaron.Handler {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Contexter middleware already checks token for user sign in process.
|
||||
func ApiReqToken() macaron.Handler {
|
||||
return func(ctx *Context) {
|
||||
if !ctx.IsSigned {
|
||||
ctx.Error(401)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func ApiReqBasicAuth() macaron.Handler {
|
||||
return func(ctx *Context) {
|
||||
if !ctx.IsBasicAuth {
|
||||
ctx.Error(401)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue