Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add expires_at, to match OmniAuth auth schema #138

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Dec 6, 2022

  1. Add expires_at, to match OmniAuth auth schema

    OmniAuth's [Auth Hash Schema] should return an `expires_at` field as a
    timestamp, but this gem returns `expires_in`.  For compatibility with
    other `oauth2` OmniAuth strategies, we 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. 🙂
    
    [Auth Hash Schema]: https://github.com/omniauth/omniauth/wiki/Auth-Hash-Schema
    
    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.
    nevans committed Dec 6, 2022
    Configuration menu
    Copy the full SHA
    2e8758d View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2023

  1. Configuration menu
    Copy the full SHA
    940d9d1 View commit details
    Browse the repository at this point in the history