Sha256: 4005ca538e1d449b63500fe84464b3d97c0091c7baeacd27c25fa6b3967888db

Contents?: true

Size: 441 Bytes

Versions: 3

Compression:

Stored size: 441 Bytes

Contents

require 'securerandom'

class GoogleSignIn::AuthorizationsController < GoogleSignIn::BaseController
  def create
    redirect_to login_url(scope: 'openid profile email', state: state),
      flash: { proceed_to: params.require(:proceed_to), state: state }
  end

  private
    def login_url(**params)
      client.auth_code.authorize_url(prompt: 'login', **params)
    end

    def state
      @state ||= SecureRandom.base64(24)
    end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
google_sign_in-1.1.2 app/controllers/google_sign_in/authorizations_controller.rb
google_sign_in-1.1.1 app/controllers/google_sign_in/authorizations_controller.rb
google_sign_in-1.1.0 app/controllers/google_sign_in/authorizations_controller.rb