Skip to content

Commit

Permalink
Merge pull request #336 from f-francine/fix/examples-in-guides-docume…
Browse files Browse the repository at this point in the history
…ntation

Fix generate_and_sign examples in guides' documentation
  • Loading branch information
victorolinasc committed Sep 9, 2021
2 parents d4cb1f1 + be6915e commit 672da2d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion guides/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ defmodule MyApp.Token do
end
end

{:ok, token} = MyApp.Token.generate_and_sign()
{:ok, token, claims} = MyApp.Token.generate_and_sign()

{:ok, claims} = MyApp.Token.verify_and_validate(token)

Expand Down
4 changes: 2 additions & 2 deletions guides/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ end
Then, just use your module :)

``` elixir
{:ok, token_with_default_claims} = MyApp.Token.generate_and_sign()
{:ok, token, claims} = MyApp.Token.generate_and_sign()

extra_claims = %{"user_id" => "some_id"}
token_with_default_plus_custom_claims = MyApp.Token.generate_and_sign!(extra_claims)
Expand All @@ -74,7 +74,7 @@ Or with explicit signer:
``` elixir
signer = Joken.Signer.create("HS256", "secret")

{:ok, token_with_default_claims} = MyApp.Token.generate_and_sign(%{}, signer)
{:ok, token, claims} = MyApp.Token.generate_and_sign(%{}, signer)

extra_claims = %{"user_id" => "some_id"}
token_with_default_plus_custom_claims = MyApp.Token.generate_and_sign!(extra_claims, signer)
Expand Down
2 changes: 1 addition & 1 deletion guides/signers.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ defmodule MyCustomAuth do
use Joken.Config
end

# Usign default signer configuration
# Using default signer configuration
MyCustomAuth.generate_and_sign()

# Explicit Signer instance
Expand Down

0 comments on commit 672da2d

Please sign in to comment.