Skip to content

Commit

Permalink
Shorten access token validity period
Browse files Browse the repository at this point in the history
To prepare for login system migration.
  • Loading branch information
RichDom2185 committed Sep 20, 2024
1 parent a72dd09 commit 90c7085
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cadet_web/controllers/auth_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ defmodule CadetWeb.AuthController do
@spec generate_tokens(User.t()) :: %{access_token: String.t(), refresh_token: String.t()}
defp generate_tokens(user) do
{:ok, access_token, _} =
Guardian.encode_and_sign(user, %{}, token_type: "access", ttl: {1, :hour})
Guardian.encode_and_sign(user, %{}, token_type: "access", ttl: {20, :minutes})

{:ok, refresh_token, _} =
Guardian.encode_and_sign(user, %{}, token_type: "refresh", ttl: {1, :week})
Expand Down

0 comments on commit 90c7085

Please sign in to comment.