OmniAuth's Auth Hash Schema should return an expires_at field as a timestamp, but this gem returns expires_in. For compatibility with omniauth-oauth2 strategies, this gem should also return expires_at.
I'm not sure if the best place to fix it is here or upstream, in Rack::OAuth2::AccessToken. On the one hand, the oauth2 gem handles it in OAuth2::AccessToken. On the other hand, the OmniAuth strategy is the only place we can ensure minimal latency between the server response and expires_at computation. I chose here. 🙂
n.b. I would have assumed that "timestamp" in the schema meant a Time object, but all of the gems that inherit from omniauth-oauth2 return Time#to_i, which is also appropriate.
OmniAuth's Auth Hash Schema should return an
expires_at
field as a timestamp, but this gem returnsexpires_in
. For compatibility withomniauth-oauth2
strategies, this gem should also returnexpires_at
.I'm not sure if the best place to fix it is here or upstream, in
Rack::OAuth2::AccessToken
. On the one hand, theoauth2
gem handles it inOAuth2::AccessToken
. On the other hand, the OmniAuth strategy is the only place we can ensure minimal latency between the server response and expires_at computation. I chose here. 🙂n.b. I would have assumed that "timestamp" in the schema meant a Time object, but all of the gems that inherit from
omniauth-oauth2
returnTime#to_i
, which is also appropriate.