We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Please help!!!!! I don't know how to use it, It doesn't inspect anything from the token.
go-micro/auth/auth.go
Line 35 in 7392705
The text was updated successfully, but these errors were encountered:
@Davincible
Sorry, something went wrong.
@thuc201995 this code maby helpful for you.
type JwtAuth struct { auth.Auth } func (a JwtAuth) Inspect(token string) (*auth.Account, error) { conf := config.Config() claims, err := Jwt{}.Validation(token, conf.JWT.Secret, false) if err != nil { return nil, err } id, _ := claims.GetSubject() return &auth.Account{ ID: id, }, nil } func NewAuthWrapper(service micro.Service) server.HandlerWrapper { return func(h server.HandlerFunc) server.HandlerFunc { return func(ctx context.Context, req server.Request, rsp interface{}) error { ... the rest code a := service.Options().Auth acc, err := a.Inspect(token) ... the rest code } } }
No branches or pull requests
Please help!!!!!
I don't know how to use it, It doesn't inspect anything from the token.
go-micro/auth/auth.go
Line 35 in 7392705
https://github.com/go-micro/examples/blob/758a9e786e6ae78456bf54bcd56d6bf672534e30/auth/auth.go#L57C4-L57C4
The text was updated successfully, but these errors were encountered: