fix: we can't use AddHandler inside BeginRequest

This commit is contained in:
Derrick Hammer 2023-06-09 04:16:58 -04:00
parent e98e2d0c89
commit f941ee46d4
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,9 @@ type FilesController struct {
}
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() {

View File

@ -17,6 +17,4 @@ func VerifyJwt(ctx iris.Context) {
ctx.StopWithError(iris.StatusUnauthorized, auth.ErrInvalidToken)
return
}
ctx.Next()
}