Skip to content

Commit

Permalink
little things: set default expiration time for login token to 24 hour…
Browse files Browse the repository at this point in the history
…s, run migration automatically (#6)
  • Loading branch information
markmark206 authored Jun 5, 2024
1 parent 9809521 commit cd46f9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/nopass.ex
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ defmodule Nopass do
Parameters:
`one_time_password`: the one-time password to verify and consume.
`opts`: optional options, including:
`expires`_after_seconds: the lifetime of the generated login token, in seconds, after which the login token expires. Optional, default: 86400 (one day)
`expires_after_seconds: the lifetime of the generated login token, in seconds, after which the login token expires. Optional, default: 86400 (one day)
`length`: the length of the random portion of the login token to be generated. Optional, default: 50
'login_token_identity': the value of the identity to be associated with the login token or the function for computing it, based on the value of the one-time-password's identity. Optional, default: the identity associated with the one-time password.
Expand All @@ -85,7 +85,7 @@ defmodule Nopass do
login_token_params =
Enum.into(opts, %{
login_token_identity: fn otp_identity -> otp_identity end,
expires_after_seconds: 600,
expires_after_seconds: 60 * 60 * 24,
length: 50
})

Expand Down
3 changes: 2 additions & 1 deletion lib/nopass/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ defmodule Nopass.Application do
@impl true
def start(_type, _args) do
children = [
Nopass.Repo
Nopass.Repo,
{Ecto.Migrator, repos: [Nopass.Repo]}
# Starts a worker by calling: Nopass.Worker.start_link(arg)
# {Nopass.Worker, arg}
]
Expand Down

0 comments on commit cd46f9f

Please sign in to comment.