Sha256: 642231bfeb30a2d1290dcb0c89eec5950e632a01690e9d9f691c80be05011f60
Contents?: true
Size: 1.24 KB
Versions: 3
Compression:
Stored size: 1.24 KB
Contents
require "sso_clyent/engine" module SsoClyent mattr_accessor :user_class, :unique_id mattr_accessor :after_sign_in_path mattr_accessor :path mattr_accessor :provyder def self.configure(config) @@user_class = config[:user_class] @@unique_id = config[:unique_id] @@after_sign_in_path = config[:after_sign_in_path] || "/" @@path = config[:path] || "/sso" @@provyder = complete_provyder(config[:provyder]) end def self.user_class @@user_class.constantize end private def self.complete_provyder(_provider=nil) options = _provider || {} base = options.reverse_merge({ :url => "http://localhost:3000#{options[:path_prefix]}", :authorize_path => '/oauth/authorize', :token_path => '/oauth/token', :user => { :path => "/user", :uid => "id", :info => %w(email), :extras => %w() } }) base.reverse_merge({ :authorize_url => "#{base[:url]}#{base[:authorize_path]}", :access_token_url => "#{base[:url]}#{base[:token_path]}", :user_url => "#{base[:url]}#{base[:user][:path]}" }) end end require 'sso_clyent/base'
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
sso_clyent-0.0.3 | lib/sso_clyent.rb |
sso_clyent-0.0.2 | lib/sso_clyent.rb |
sso_clyent-0.0.1 | lib/sso_clyent.rb |