mirror of
https://github.com/go-gitea/gitea
synced 2025-07-08 19:47:21 +00: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