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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悶 auth-jwt project panics in UpdateUser handler #1872

Closed
mbicl opened this issue Aug 25, 2023 · 4 comments
Closed

馃悶 auth-jwt project panics in UpdateUser handler #1872

mbicl opened this issue Aug 25, 2023 · 4 comments
Labels
鈽笍 Bug Something isn't working

Comments

@mbicl
Copy link

mbicl commented Aug 25, 2023

In auth-jwt project patch request for UpdateUser panics:

panic: interface conversion: interface {} is *jwt.Token, not *jwt.Token (types from different packages)

goroutine 34 [running]:
api-fiber-gorm/handler.UpdateUser(0x14000200c00)
/Users/mbi/Dev/GO/jwt_auth/recipes/auth-jwt/handler/user.go:99 +0x594
github.com/gofiber/fiber/v2.(*Ctx).Next(0x140003b1801?)
/Users/mbi/Dev/GO/pkg/mod/github.com/gofiber/fiber/v2@v2.48.0/ctx.go:906 +0x48
github.com/gofiber/contrib/jwt.makeCfg.func1(0x1047d0a4c?)
/Users/mbi/Dev/GO/pkg/mod/github.com/gofiber/contrib/jwt@v1.0.4/config.go:111 +0x1c
github.com/gofiber/contrib/jwt.New.func1(0x140001ff980?)
/Users/mbi/Dev/GO/pkg/mod/github.com/gofiber/contrib/jwt@v1.0.4/jwt.go:55 +0x2d8
github.com/gofiber/fiber/v2.(*App).next(0x14000296900, 0x14000200c00)
/Users/mbi/Dev/GO/pkg/mod/github.com/gofiber/fiber/v2@v2.48.0/router.go:144 +0x184
github.com/gofiber/fiber/v2.(*Ctx).Next(0x140003b0fc0?)
/Users/mbi/Dev/GO/pkg/mod/github.com/gofiber/fiber/v2@v2.48.0/ctx.go:909 +0x5c
github.com/gofiber/fiber/v2/middleware/logger.New.func3(0x14000200c00)
/Users/mbi/Dev/GO/pkg/mod/github.com/gofiber/fiber/v2@v2.48.0/middleware/logger/logger.go:122 +0x2cc
github.com/gofiber/fiber/v2.(*App).next(0x14000296900, 0x14000200c00)
/Users/mbi/Dev/GO/pkg/mod/github.com/gofiber/fiber/v2@v2.48.0/router.go:144 +0x184
github.com/gofiber/fiber/v2.(*Ctx).Next(0x14000422330?)
/Users/mbi/Dev/GO/pkg/mod/github.com/gofiber/fiber/v2@v2.48.0/ctx.go:909 +0x5c
github.com/gofiber/fiber/v2/middleware/cors.New.func1(0x14000200c00)
/Users/mbi/Dev/GO/pkg/mod/github.com/gofiber/fiber/v2@v2.48.0/middleware/cors/cors.go:162 +0x2b8
github.com/gofiber/fiber/v2.(*App).next(0x14000296900, 0x14000200c00)
/Users/mbi/Dev/GO/pkg/mod/github.com/gofiber/fiber/v2@v2.48.0/router.go:144 +0x184
github.com/gofiber/fiber/v2.(*App).handler(0x14000296900, 0x10464d794?)
/Users/mbi/Dev/GO/pkg/mod/github.com/gofiber/fiber/v2@v2.48.0/router.go:171 +0x74
github.com/valyala/fasthttp.(*Server).serveConn(0x14000216600, {0x1049ba9d0?, 0x14000402008})
/Users/mbi/Dev/GO/pkg/mod/github.com/valyala/fasthttp@v1.48.0/server.go:2363 +0xdd0
github.com/valyala/fasthttp.(*workerPool).workerFunc(0x1400029df40, 0x1400041c000)
/Users/mbi/Dev/GO/pkg/mod/github.com/valyala/fasthttp@v1.48.0/workerpool.go:224 +0x70
github.com/valyala/fasthttp.(*workerPool).getCh.func1()
/Users/mbi/Dev/GO/pkg/mod/github.com/valyala/fasthttp@v1.48.0/workerpool.go:196 +0x38
created by github.com/valyala/fasthttp.(*workerPool).getCh
/Users/mbi/Dev/GO/pkg/mod/github.com/valyala/fasthttp@v1.48.0/workerpool.go:195 +0x220
exit status 2

@welcome
Copy link

welcome bot commented Aug 25, 2023

Thanks for opening your first issue here! 馃帀 Be sure to follow the issue template!

@mbicl mbicl changed the title 馃悶 馃悶 auth-jwt project panics in UpdateUser handler Aug 25, 2023
@ReneWerner87
Copy link
Member

unfortunately we can't help you, there must be two different packets in your imports in the project

i would suggest a cleanup of the vendor directory

@ReneWerner87 ReneWerner87 added the 鈽笍 Bug Something isn't working label Aug 25, 2023
@mbicl
Copy link
Author

mbicl commented Aug 25, 2023

unfortunately we can't help you, there must be two different packets in your imports in the project

i would suggest a cleanup of the vendor directory

Ah, yes. I will try to cleanup.

@mbicl
Copy link
Author

mbicl commented Aug 25, 2023

unfortunately we can't help you, there must be two different packets in your imports in the project

i would suggest a cleanup of the vendor directory

There is no other imports. I just clone this repo, run auth-jwt project and when send patch request to /api/user/:id endpoint it's panics with this error. Is it my mistake?

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