Class: RubyNative::Auth::StartController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/ruby_native/auth/start_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/ruby_native/auth/start_controller.rb', line 4

def show
  @provider = params[:provider]

  unless @provider.match?(/\A[a-z0-9_]+\z/)
    head :bad_request
    return
  end

  oauth_paths = RubyNative.config&.dig(:auth, :oauth_paths) || []
  @oauth_path = oauth_paths.find { |p| p.end_with?(@provider) } || "/auth/#{@provider}"
  @callback_scheme = params[:callback_scheme]
end