sinatra_omniauth 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -155,8 +155,7 @@ module SinatraOmniAuth
155
155
  app.get '/auth' do
156
156
  @authentications_possible = settings.omniauth
157
157
 
158
- if current_user
159
- @authentication_current = current_auth
158
+ if current_user and @authentication_current = current_auth
160
159
  @authentications_available = current_user.authentications.all(:order => [ :provider.desc ])
161
160
  @authentications_unused = @authentications_available.
162
161
  reject do|a|
@@ -282,14 +281,17 @@ module SinatraOmniAuth
282
281
  end
283
282
 
284
283
  # authentication
285
- app.delete '/auth/:id' do
284
+ app.delete '/auth/:provider' do
286
285
  authenticate_user!
287
286
 
288
287
  # remove an authentication authentication linked to the current user
289
- @authentication = current_user.authentications.get(params[:id])
288
+ provider = params[:provider]
289
+ @authentication = current_user.authentications.first(:provider => provider)
290
290
 
291
- if session[:authentication_provider] == @authentication.provider
292
- flash.error = 'You can\'t delete this authorization because you are currently signed in with it!'
291
+ if !@authentication
292
+ pass
293
+ elsif session[:authentication_provider] == @authentication.provider
294
+ flash.error = 'You can\'t delete your authorization through #{provider.capitalize} because you are currently signed in with it!'
293
295
  else
294
296
  @authentication.destroy
295
297
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sinatra_omniauth}
8
- s.version = "1.0.0"
8
+ s.version = "1.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Clifford Heath}]
12
- s.date = %q{2011-08-10}
12
+ s.date = %q{2011-08-17}
13
13
  s.description = %q{This Sinatra extension, derived from omniauth_pure by Marcus Proske, adds OmniAuth authorization to your Sinatra application, so your users can login using FaceBook, Twitter and many other authorization providers, as long as you supply the API keys. It uses DataMapper and HAML.}
14
14
  s.email = %q{clifford.heath@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -33,7 +33,7 @@
33
33
  .authentication.available{:style=>"background-image: url(/images/authbuttons/#{a.provider}_32.png)",:onclick=>"location = '/auth/#{a.provider}';"}
34
34
  .provider= a.provider.titleize
35
35
  .uid= a.uid
36
- %a.remove{:href=>"/auth/#{a.id}", :method => :delete, :rel => 'nofollow', :'data-confirm' => 'Are you sure you want to remove this authentication option?'} x
36
+ %a.remove{:href=>"/auth/#{a.provider}", :method => :delete, :rel => 'nofollow', :'data-confirm' => 'Are you sure you want to remove this authentication option?'} x
37
37
 
38
38
  %section.join
39
39
  - if current_user
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra_omniauth
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Clifford Heath
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-10 00:00:00 Z
18
+ date: 2011-08-17 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  version_requirements: &id001 !ruby/object:Gem::Requirement