Skip to content

Commit 8b1b32c

Browse files
authored
Clarify and emphasize signed_at/max_age (elixir-plug#49)
1 parent b0665ea commit 8b1b32c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/plug/crypto.ex

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ defmodule Plug.Crypto do
175175
when generating the encryption and signing keys. Defaults to 32
176176
* `:key_digest` - option passed to `Plug.Crypto.KeyGenerator`
177177
when generating the encryption and signing keys. Defaults to `:sha256`
178-
* `:signed_at` - set the timestamp of the token in seconds.
179-
Defaults to `System.os_time(:millisecond)`
180-
* `:max_age` - the default maximum age of the token. Defaults to
178+
* `:signed_at` - set the timestamp of the token in **seconds**.
179+
If no value is provided, it will be set to the current time.
180+
* `:max_age` - the default maximum age in **seconds** of the token. Defaults to
181181
`86400` seconds (1 day) and it may be overridden on `verify/4`.
182182
183183
"""
@@ -203,9 +203,9 @@ defmodule Plug.Crypto do
203203
when generating the encryption and signing keys. Defaults to 32
204204
* `:key_digest` - option passed to `Plug.Crypto.KeyGenerator`
205205
when generating the encryption and signing keys. Defaults to `:sha256`
206-
* `:signed_at` - set the timestamp of the token in seconds.
207-
Defaults to `System.os_time(:millisecond)`
208-
* `:max_age` - the default maximum age of the token. Defaults to
206+
* `:signed_at` - set the timestamp of the token in **seconds**.
207+
If no value is provided, it will be set to the current time.
208+
* `:max_age` - the default maximum age in **seconds** of the token. Defaults to
209209
`86400` seconds (1 day) and it may be overridden on `decrypt/4`.
210210
211211
"""
@@ -264,7 +264,7 @@ defmodule Plug.Crypto do
264264
## Options
265265
266266
* `:max_age` - verifies the token only if it has been generated
267-
"max age" ago in seconds. Defaults to the max age signed in the
267+
"max age" ago in **seconds**. Defaults to the max age signed in the
268268
token (86400)
269269
* `:key_iterations` - option passed to `Plug.Crypto.KeyGenerator`
270270
when generating the encryption and signing keys. Defaults to 1000
@@ -296,7 +296,7 @@ defmodule Plug.Crypto do
296296
## Options
297297
298298
* `:max_age` - verifies the token only if it has been generated
299-
"max age" ago in seconds. A reasonable value is 1 day (86400
299+
"max age" ago in **seconds**. A reasonable value is 1 day (86400
300300
seconds)
301301
* `:key_iterations` - option passed to `Plug.Crypto.KeyGenerator`
302302
when generating the encryption and signing keys. Defaults to 1000

0 commit comments

Comments
 (0)