0

我有这个 Rails 5 应用程序,其中使用 gems 使用您的 google 帐户完成登录:

gem 'omniauth', '~> 2.0.3'
gem 'omniauth-google-oauth2', '0.5.3'
gem 'omniauth-oauth2', '1.7.1'

目前这是我的设置:

  Rails.application.config.middleware.use OmniAuth::Builder do
    # provider :developer unless Rails.env.production?
    provider :google_oauth2, ENV['GOOGLE_CLIENT_ID'], ENV['GOOGLE_CLIENT_SECRET'], {
      :scope => 'email,profile', prompt: 'select_account'
    }
  end

并查看我得到的凭据expires_at=1618943973

<OmniAuth::AuthHash 
expires=true 
expires_at=1618943973 
refresh_token="1//..." 
token="...">

我希望会话持续 1 天,但我还没有找到改变它的方法。

如何更改此号码?

4

0 回答 0