We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2673725 commit b6dd5b4Copy full SHA for b6dd5b4
lib/ex_oauth2_provider/mixin/expirable.ex
@@ -40,9 +40,10 @@ defmodule ExOauth2Provider.Mixin.Expirable do
40
@spec is_expired?(Schema.t() | nil) :: boolean()
41
def is_expired?(nil), do: true
42
def is_expired?(%{expires_in: nil, inserted_at: _}), do: false
43
+
44
def is_expired?(%struct{expires_in: expires_in, inserted_at: inserted_at}) do
- now = SchemaHelpers.__timestamp_for__(struct, :inserted_at)
45
- type = now.__struct__()
+ now = SchemaHelpers.__timestamp_for__(struct, :inserted_at)
46
+ type = now.__struct__
47
48
inserted_at
49
|> type.add(expires_in, :second)
0 commit comments