Sha256: 3a572a0b35f680d542e8484069be00404a16de6a2594f1edffdb94a5837e93f4
Contents?: true
Size: 1.83 KB
Versions: 4
Compression:
Stored size: 1.83 KB
Contents
require 'selfsdk' if defined?(Rails::Server) && !defined?(::SelfClient) # If self client is already initialized skip this initialization return unless defined?(::SelfClient).nil? # Initializes self client ::SelfClient = SelfSDK::App.new( ENV['SELF_APP_ID'], ENV['SELF_APP_KEY'], ENV['SELF_STORAGE_KEY'], ENV['SELF_STORAGE_DIR'], env: ENV['SELF_ENVIRONMENT'], ) # Setup self-auth-rails engine SelfAuthRails.setup do |config| # Initializes the self-ruby-sdk client. config.self_client = ::SelfClient # Sets rails logger as default self-ruby-sdk logger (optional). SelfSDK.logger = Rails.logger # Defines the facts we're going to require for a user to authenticate. # If not provided it will default to [:display_name]. config.auth_facts = [:display_name, :email_address] # Defines the model class name to be used for persistance. The active # model provided must have `selfid` and `token` attributes. # Note this config entry is optional and defaults to `User`. config.session_class_name = 'User' # Defines the path to redirect the user when authentication succeeds. # Optional entry defaulting to '/'. config.authenticated_path = '/' # Defines the layout to be used for the authentication page. # config.layout = 'login' # In case you want to persist the authentication returning facts, you # can provide a map for the fact_name and the ActiveModel object property. # # This is an optional entry and you only need to provide it if you're intending # to request and store facts during the authentication process with # config.auth_facts config.fact_mapping = { display_name: :name } # Defines if a given user is permitted to access the service or not. # config.permitted_auth = Proc.new do |selfid| # true # end end end
Version data entries
4 entries across 4 versions & 1 rubygems