entrance 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,16 +44,15 @@ module Entrance
44
44
  app.send(:include, Entrance::Controller) # provides redirects, etc
45
45
 
46
46
  app.use ::OmniAuth::Builder do
47
- # this is run after the app has initialized, so it's safe to use it here.
47
+ # this is run only once after the app has initialized, so it's safe to set it here.
48
48
  if app.settings.respond_to?(:auth_test)
49
49
  ::OmniAuth.config.test_mode = true if app.settings.auth_test?
50
50
  end
51
51
 
52
52
  app.settings.auth_providers.each do |name, options|
53
53
  # puts "Initializing #{name} provider: #{options.inspect}"
54
- # omniauth expects provider(:name, arg1, arg2, arg3), so we need to map only the values
55
- opts = options && options.any? ? options.values : []
56
- provider(name, *opts)
54
+ opts = options || {}
55
+ provider(name, opts[:key], opts[:secret], opts[:extra] || {})
57
56
  end
58
57
  end
59
58
 
@@ -1,4 +1,26 @@
1
1
  require 'entrance'
2
+ require 'erb'
3
+
4
+ =begin
5
+
6
+ Simple login/signup support for sinatra. This extension
7
+ expects a login.erb and a signup.erb (unless disabled) to
8
+ be present in a views/public directory.
9
+
10
+ Once a user logs in, he or she will be redirected to /.
11
+
12
+ require 'sinatra/base'
13
+ require 'entrance/sinatra'
14
+
15
+ class Hello < Sinatra::Base
16
+ register Entrance::Sinatra
17
+
18
+ before do
19
+ login_required :except => ['/login', '/signup'] # or just /login if you don't want signups
20
+ end
21
+ end
22
+
23
+ =end
2
24
 
3
25
  module Entrance
4
26
 
@@ -1,7 +1,7 @@
1
1
  module Entrance
2
2
  MAJOR = 0
3
3
  MINOR = 4
4
- PATCH = 1
4
+ PATCH = 2
5
5
 
6
6
  VERSION = [MAJOR, MINOR, PATCH].join('.')
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: entrance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: