Sha256: c0428d68fabd4f173c9ba3f17e704cdadfb8cecadf2d436f43c816d5571c3f74
Contents?: true
Size: 765 Bytes
Versions: 3
Compression:
Stored size: 765 Bytes
Contents
# encoding: utf-8 require 'omniauth-github' module OpenSesame class GithubAuth < ::OmniAuth::Strategies::GitHub option :name, 'github' option :path_prefix, OpenSesame.mount_prefix option :on_failure, OpenSesame::Failure::App.new # overrides OmniAuth::Strategy#fail! def fail!(message_key, exception = nil) self.env['omniauth.error'] = exception self.env['omniauth.error.type'] = message_key.to_sym self.env['omniauth.error.strategy'] = self if exception log :error, "Authentication failure! #{message_key}: #{exception.class.to_s}, #{exception.message}" else log :error, "Authentication failure! #{message_key} encountered." end options.on_failure.call(self.env) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
opensesame-0.4.0 | lib/open_sesame/github_auth.rb |
opensesame-0.3.0 | lib/open_sesame/github_auth.rb |
opensesame-0.2.0 | lib/open_sesame/github_auth.rb |