fix: we can't use AddHandler inside BeginRequest
This commit is contained in:
parent
e98e2d0c89
commit
f941ee46d4
|
@ -17,7 +17,9 @@ type FilesController struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *FilesController) BeginRequest(ctx iris.Context) {
|
func (f *FilesController) BeginRequest(ctx iris.Context) {
|
||||||
ctx.AddHandler(middleware.VerifyJwt)
|
middleware.VerifyJwt(ctx)
|
||||||
|
}
|
||||||
|
func (f *FilesController) EndRequest(ctx iris.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *FilesController) PostUpload() {
|
func (f *FilesController) PostUpload() {
|
||||||
|
|
|
@ -17,6 +17,4 @@ func VerifyJwt(ctx iris.Context) {
|
||||||
ctx.StopWithError(iris.StatusUnauthorized, auth.ErrInvalidToken)
|
ctx.StopWithError(iris.StatusUnauthorized, auth.ErrInvalidToken)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.Next()
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue