Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not found error skipped in JWT Controller #221

Closed
akhedrane opened this issue Aug 7, 2024 · 3 comments
Closed

Not found error skipped in JWT Controller #221

akhedrane opened this issue Aug 7, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@akhedrane
Copy link

Hello,
Not found error skipped in JWT Controller that caused reflection error on line 123

pass := t.FieldByName(c.PasswordField)

@System-Glitch System-Glitch added the bug Something isn't working label Aug 8, 2024
@System-Glitch
Copy link
Member

Hello. Thank you for your report. Can you include a stack trace please?

@akhedrane
Copy link
Author

ERROR  2024/08/08 10:03:05.14237 (/go/pkg/mod/goyave.dev/goyave/[email protected]/middleware.go:84)

reflect: call of reflect.Value.FieldByName on zero Value
trace: 
reflect.flag.mustBe
       /Go/src/reflect/value.go:233
reflect.Value.FieldByName
        /Go/src/reflect/value.go:1361
goyave.dev/goyave/v5/auth.(*JWTController[...]).Login
        /go/pkg/mod/goyave.dev/goyave/[email protected]/auth/jwt_controller.go:123
goyave.dev/goyave/v5.(*validateRequestMiddleware).Handle.func1
        /go/pkg/mod/goyave.dev/goyave/[email protected]/middleware.go:202
goyave.dev/goyave/v5/middleware/parse.(*Middleware).Handle.func1
        /go/pkg/mod/goyave.dev/goyave/[email protected]/middleware/parse/parse.go:55
goyave.dev/goyave/v5/middleware/parse.(*Middleware).Handle.func1
        /go/pkg/mod/goyave.dev/goyave/[email protected]/middleware/parse/parse.go:97
goyave.dev/goyave/v5/auth.(*Handler[...]).Handle.func1
        /go/pkg/mod/goyave.dev/goyave/[email protected]/auth/authenticator.go:70
goyave.dev/goyave/v5/log.(*AccessMiddleware).Handle.func1
        /go/pkg/mod/goyave.dev/goyave/[email protected]/log/log.go:100
goyave.dev/goyave/v5.(*corsMiddleware).Handle.func1
        /go/pkg/mod/goyave.dev/goyave/[email protected]/middleware.go:237
goyave.dev/goyave/v5.(*languageMiddleware).Handle.func1
        /go/pkg/mod/goyave.dev/goyave/[email protected]/middleware.go:118
goyave.dev/goyave/v5.(*recoveryMiddleware).Handle.func1
        /go/pkg/mod/goyave.dev/goyave/[email protected]/middleware.go:90
goyave.dev/goyave/v5.(*Router).requestHandler
        /go/pkg/mod/goyave.dev/goyave/[email protected]/router.go:511
goyave.dev/goyave/v5.(*Router).ServeHTTP
        /go/pkg/mod/goyave.dev/goyave/[email protected]/router.go:284
net/http.serverHandler.ServeHTTP
        /src/net/http/server.go:3142
net/http.(*conn).serve
        /src/net/http/server.go:2044

 INFO  2024/08/08 10:03:05.14237 (/go/pkg/mod/goyave.dev/goyave/[email protected]/log/log.go:79)
127.0.0.1 - - [08/Aug/2024:10:03:05 +0100] "POST "/login" HTTP/1.1" 500 69 "" "PostmanRuntime/7.41.0"

@akhedrane
Copy link
Author

akhedrane commented Aug 8, 2024

This error occurred after trying to login with non-exist username in goyave-blog-example
IMHO i think this case should returned either 404 error or 403 not 500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants