mirror of
https://gitee.com/gitea/gitea
synced 2025-11-10 19:40:25 +08:00
refactor API routes and some work for #976
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user