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

Skip Routes #44

Open
manu-mel opened this issue May 6, 2024 · 1 comment
Open

Skip Routes #44

manu-mel opened this issue May 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@manu-mel
Copy link

manu-mel commented May 6, 2024

Estou implementando uma API com autenticação JWT, no entanto, não consigo configurar as rotas que não precisam de autenticação. Se eu comentar a linha:

.Use(HorseJWT('my-token', THorseJWTConfig.New.SkipRoutes(['Acesso'])));

Consigo fazer o POST e pegar o JWT. O token gerado é válido. A questão me parece realmente estar ligada ao Skip Routes, mas não consigo identificar a origem.

Segue repositório com exemplo, a base utilizada é a DVDRentals, uma base mock em Postgres disponível na internet.
https://github.com/manu-mel/api_horse

@viniciussanchez viniciussanchez added the bug Something isn't working label May 8, 2024
@viniciussanchez viniciussanchez moved this to Todo in Horse May 8, 2024
@davisouzatb
Copy link
Contributor

Eu uso normalmente na minha aplicação exemplo de uso:

 THorse
    .Use(Compression())
    .Use(ServerStatic('public'))
    .Use(HorseJWT(__secretKey,
                  THorseJWTConfig.New.SkipRoutes(['usuarios/auth',
                                                  'licencas',
                                                  'doc',
                                                  'state',
                                                  'swagger/doc/html',
                                                  'swagger/doc/json',
                                                  'hslog',
                                                  'api/ibge/:ibge',
                                                  'api/placa/:placa/:cnpj'])))
    .Use(Jhonson)

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
Status: Todo
Development

No branches or pull requests

3 participants