Skip to content

Commit

Permalink
Merge pull request #3 from mmusnjak/main
Browse files Browse the repository at this point in the history
Fix readme so example works
  • Loading branch information
brettkolodny authored Nov 13, 2024
2 parents 601f776 + c88d201 commit 3c85969
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ Encode and decode JWTs.
import gwt.{type Jwt, type Verified, type Unverified}
pub fn main() {
let jwt_builder =
let jwt_builder =
gwt.new()
|> gwt.set_subject("1234567890")
|> gwt.set_audience("0987654321")
|> gwt.set_not_before(1_704_043_160)
|> gwt.set_expiration(1_704_046_160)
|> gwt.set_jwt_id("2468")
let jwt_without_signature = gwt.to_string(jwt)
let jwt_with_signature = gwt.to_signed_string(jwt, gwt.HS256, "lucy")
let jwt_without_signature = gwt.to_string(jwt_builder)
let jwt_with_signature = gwt.to_signed_string(jwt_builder, gwt.HS256, "lucy")
let assert Ok(unverified_jwt) =
let assert Ok(unverified_jwt) =
jwt_without_signature
|> gwt.from_string()
let assert Ok(verified_jwt) =
let assert Ok(verified_jwt) =
jwt_with_signature
|>gwt.from_signed_string("lucy")
}
Expand All @@ -35,7 +35,7 @@ pub fn main() {
## Installation

```sh
gleam add gwt
gleam add gwt
```

The documentation can be found at <https://hexdocs.pm/gwt>.

0 comments on commit 3c85969

Please sign in to comment.