Skip to content

Commit b6dd5b4

Browse files
committed
Fix deprecation error when using in 1.18 projects
1 parent 2673725 commit b6dd5b4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/ex_oauth2_provider/mixin/expirable.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ defmodule ExOauth2Provider.Mixin.Expirable do
4040
@spec is_expired?(Schema.t() | nil) :: boolean()
4141
def is_expired?(nil), do: true
4242
def is_expired?(%{expires_in: nil, inserted_at: _}), do: false
43+
4344
def is_expired?(%struct{expires_in: expires_in, inserted_at: inserted_at}) do
44-
now = SchemaHelpers.__timestamp_for__(struct, :inserted_at)
45-
type = now.__struct__()
45+
now = SchemaHelpers.__timestamp_for__(struct, :inserted_at)
46+
type = now.__struct__
4647

4748
inserted_at
4849
|> type.add(expires_in, :second)

0 commit comments

Comments
 (0)