Giter Club home page Giter Club logo

Comments (8)

cristaloleg avatar cristaloleg commented on May 15, 2024 1

ok, sounds good, will try to fix today, thank you for the feedback 👍

from jwt.

cristaloleg avatar cristaloleg commented on May 15, 2024 1

I prefer 1 just to reduce copy-paste and for an easier example/test/code maintainability. BTW, I got your point, will push slightly updated README now.

Thanks once more for the feedback 😉

from jwt.

cristaloleg avatar cristaloleg commented on May 15, 2024 1

Hi @elgs if you've any suggestions for v2 please add them here :) #39

from jwt.

cristaloleg avatar cristaloleg commented on May 15, 2024

Hi, this can be done via https://godoc.org/github.com/cristalhq/jwt#Signer (See Verify method). Signing and verifying token is a pure Signer task.

from jwt.

elgs avatar elgs commented on May 15, 2024

Thanks. It looks like I confused validate and verify. Would be great if you could add a few examples in the readme.md, like:

  1. how to turn a JSON string into a jwt string;
  2. how to verify a jwt string;

As a user, we don't want to mess with your internal types, unless necessary, in most cases, we start with a raw JSON string, and we expect a jwt string, and for verification, we start with a jwt string and a string typed secret, and expect a boolean answer.

from jwt.

elgs avatar elgs commented on May 15, 2024

Thank you so much! Last question, it would be great if you could put an example of verify in the readme.md.

from jwt.

cristaloleg avatar cristaloleg commented on May 15, 2024

@elgs but there is already a full example in example files (there are links in README.md)

from jwt.

elgs avatar elgs commented on May 15, 2024

The links only says build, parse, validate in the README.md, with your instruction, I figured how to get things done. There are two types of people:

  1. if there's example in the code, why would I bother to write them in README.md;
  2. if I could put examples in README.md, why would I bother users to read the code;

I fully respect each of styles. So it's fine to keep the examples in the code. Thank you so much!

from jwt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.