0

Is there the way to refresh Guardian access token, if the one is expired?

Vadym
  • 149
  • 1
  • 9

1 Answers1

1

Expired tokens cannot be used by definition. You should refresh a token before it expires. Per package readme, you would do it like this:

# Refresh a token before it expires
{:ok, _old_stuff, {new_token, new_claims}} = MyApp.Guardian.refresh(token)
oldhomemovie
  • 14,621
  • 13
  • 64
  • 99