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

signing jwt while testing manually #221

Open
surajsharma opened this issue Sep 1, 2022 · 3 comments
Open

signing jwt while testing manually #221

surajsharma opened this issue Sep 1, 2022 · 3 comments

Comments

@surajsharma
Copy link

For those of us who want to test the routes manually using a REST client, what's the best way to go about generating and signing the tokens?

@goldbergyoni
Copy link
Contributor

I've actually inlucded the token within the online POSTMAN docs but just noted that for security reasons it extract out the Authorization header.

I've just included here an _answer to your question, is it satisfactory?

Note that when invoking manually you might hit another wall - the code is approaching 3rd party service (we want to tackle this complexity and show how to test it), since that imaginary service is not available your code will fail. In the automated tests we use a special networking tool, nock, that mocks that service

Visit the file user-service-client.ts and change the URL to any REST service that is available, or just return something hard-coded

p.s. May I ask, which type of app are you building using Practica?

@surajsharma
Copy link
Author

surajsharma commented Sep 1, 2022

@goldbergyoni

I've just included here an _answer to your question, is it satisfactory?

so yes while this token works i wanted to be able to generate my own tokens, or at least know my way around, is there any way this could be achieved?

Visit the file user-service-client.ts and change the URL to any REST service that is available, or just return something hard-coded

ok let me try this

p.s. May I ask, which type of app are you building using Practica?

i am just learning the best practices, not building anything.

@goldbergyoni
Copy link
Contributor

@surajsharma The link explains how to generate your own token. If you could feedback what specifically in this text is lacking - we can improve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants